This commit is contained in:
IndieKKY
2024-10-03 19:48:55 +08:00
parent 5b6b4211a4
commit 66cd431c3b
5 changed files with 391 additions and 302 deletions

View File

@@ -27,10 +27,9 @@ export default defineManifest(async (env) => ({
"service_worker": "src/chrome/background.ts",
"type": "module"
},
"options_page": "options.html",
"content_scripts": [
{
"matches": ["https://www.bilibili.com/video/*", "https://www.bilibili.com/list/*"],
"matches": ["https://*.bilibili.com/*"],
"js": ["src/inject/inject.ts"]
}
],
@@ -51,9 +50,7 @@ export default defineManifest(async (env) => ({
},
"web_accessible_resources": [
{
"matches": [
"https://www.bilibili.com/video/*", "https://www.bilibili.com/list/*"
],
"matches": ["https://*.bilibili.com/*"],
"resources": [
"index.html",
],

View File

@@ -58,7 +58,7 @@
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"@vitejs/plugin-react": "^2.1.0",
"@vitejs/plugin-react": "^2.2.0",
"autoprefixer": "^10.4.13",
"eslint": "8.22.0",
"eslint-config-standard": "^17.0.0",
@@ -72,6 +72,6 @@
"rollup-plugin-visualizer": "^5.8.3",
"tailwindcss": "^3.2.4",
"typescript": "^4.8.3",
"vite": "^3.1.1"
"vite": "^3.2.7"
}
}

675
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -188,6 +188,7 @@ window.addEventListener("message", (event) => {
info: data.info,
data: res,
}, type: 'setSubtitle'
// @ts-ignore
}, '*')
})
}
@@ -199,6 +200,7 @@ window.addEventListener("message", (event) => {
data: {
currentTime: video.currentTime
}, type: 'setCurrentTime'
// @ts-ignore
}, '*')
}
}
@@ -211,6 +213,7 @@ window.addEventListener("message", (event) => {
noVideo: !videoElement,
totalHeight,
}, type: 'setSettings'
// @ts-ignore
}, '*')
}

View File

@@ -4,10 +4,10 @@ import {visualizer} from "rollup-plugin-visualizer";
import {crx} from '@crxjs/vite-plugin'
import path from "path"
// @ts-ignore
import manifest from './manifest.json'
import manifest from './manifest.config'
// https://vitejs.dev/config/
export default ({mode}) => {
export default () => {
return defineConfig({
base: '/',
build: {