feat: support 'bid' domain of jbus
This commit is contained in:
@@ -10,14 +10,18 @@ import App from "./components/App";
|
||||
|
||||
function main() {
|
||||
/** 当前匹配的图书馆站点对象 */
|
||||
const libItem = libSites.find((item) => item.href.test(window.location.href)) as LibItem;
|
||||
const libItem = libSites.find((item) => item.href.test(window.location.href));
|
||||
if (!libItem) {
|
||||
console.error("脚本挂载错误");
|
||||
return;
|
||||
}
|
||||
const CODE = getCode(libItem);
|
||||
|
||||
// 执行对于当前图书馆站的特殊适配,如单独的样式改动
|
||||
libItem.method();
|
||||
|
||||
const panel = document.querySelector<HTMLElement>(libItem.querys.panelQueryStr);
|
||||
if (panel === null) {
|
||||
if (!panel) {
|
||||
console.error("脚本挂载错误");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { LibItem } from "./libSites";
|
||||
import { type LibItem } from "./libSites";
|
||||
|
||||
export function getCode(cms: LibItem): string {
|
||||
const { codeQueryStr } = cms.querys;
|
||||
export function getCode(libItem: LibItem): string {
|
||||
const { codeQueryStr } = libItem.querys;
|
||||
const codeNode = document.querySelector<HTMLElement>(codeQueryStr);
|
||||
if (!codeNode) return "";
|
||||
|
||||
const codeText =
|
||||
cms.name === "javdb"
|
||||
libItem.name === "javdb"
|
||||
? (codeNode.dataset.clipboardText as string)
|
||||
: codeNode.innerText.replace("复制", "");
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const libSites: LibItem[] = [
|
||||
{
|
||||
name: "javdb",
|
||||
enable: true,
|
||||
href: /^https:\/\/(\w*\.)?javdb(\d)*\.com.*$/,
|
||||
href: /^https?:\/\/(\w*\.)?javdb(\d)*\.com.*$/,
|
||||
querys: {
|
||||
panelQueryStr: ".video-meta-panel>.columns.is-desktop .panel.movie-panel-info",
|
||||
codeQueryStr: `[data-clipboard-text]`,
|
||||
@@ -34,7 +34,7 @@ export const libSites: LibItem[] = [
|
||||
{
|
||||
name: "javbus",
|
||||
enable: true,
|
||||
href: /^https?:\/\/(\w*\.)?(javbus|seejav|javsee)*\.(com|cc|me|life).*$/,
|
||||
href: /^https?:\/\/(\w*\.)?(javbus|seejav|javsee)*\.(com|cc|me|life|bid).*$/,
|
||||
querys: {
|
||||
panelQueryStr: ".movie>div.info",
|
||||
codeQueryStr: `span[style="color:#CC0000;"]`,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["vite.config.ts", "src/utils/siteList.ts"]
|
||||
}
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["vite.config.ts", "src/utils/siteList.ts", "src/utils/libSites.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user