You've already forked bilibili-subtitle
大重构,优化本地调试
This commit is contained in:
63
manifest.config.ts
Normal file
63
manifest.config.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import {defineManifest} from '@crxjs/vite-plugin'
|
||||
// @ts-ignore
|
||||
import packageJson from './package.json'
|
||||
|
||||
const {version} = packageJson
|
||||
|
||||
// Convert from Semver (example: 0.1.0-beta6)
|
||||
const [major, minor, patch, label = '0'] = version
|
||||
// can only contain digits, dots, or dash
|
||||
.replace(/[^\d.-]+/g, '')
|
||||
// split into version parts
|
||||
.split(/[.-]/)
|
||||
|
||||
export default defineManifest(async (env) => ({
|
||||
"name": "哔哩哔哩字幕列表",
|
||||
"description": "显示B站视频的字幕列表,可点击跳转与下载字幕,并支持翻译和总结字幕!",
|
||||
"version": `${major}.${minor}.${patch}`,
|
||||
"manifest_version": 3,
|
||||
"permissions": [
|
||||
"storage",
|
||||
],
|
||||
"host_permissions": [
|
||||
"http://localhost/*",
|
||||
"http://127.0.0.1/*"
|
||||
],
|
||||
"background": {
|
||||
"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/*"],
|
||||
"js": ["src/inject/inject.ts"]
|
||||
}
|
||||
],
|
||||
"icons": {
|
||||
"16": "favicon-16x16.png",
|
||||
"32": "favicon-32x32.png",
|
||||
"48": "favicon-48x48.png",
|
||||
"128": "favicon-128x128.png"
|
||||
},
|
||||
"action": {
|
||||
"default_popup": "popup.html",
|
||||
"default_icon": {
|
||||
"16": "favicon-16x16.png",
|
||||
"32": "favicon-32x32.png",
|
||||
"48": "favicon-48x48.png",
|
||||
"128": "favicon-128x128.png"
|
||||
}
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"matches": [
|
||||
"https://www.bilibili.com/video/*", "https://www.bilibili.com/list/*"
|
||||
],
|
||||
"resources": [
|
||||
"index.html",
|
||||
],
|
||||
"use_dynamic_url": true
|
||||
}
|
||||
]
|
||||
}))
|
Reference in New Issue
Block a user