You've already forked bilibili-subtitle
添加firefox支持
This commit is contained in:
22
fixFirefox.cjs
Normal file
22
fixFirefox.cjs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
console.log('fixFirefox.js loaded');
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
const manifest = require('./dist/manifest.json')
|
||||||
|
manifest.web_accessible_resources[0].resources.push('index.html')
|
||||||
|
manifest.action.default_popup = 'popup.html'
|
||||||
|
//browser_specific_settings
|
||||||
|
manifest.browser_specific_settings = {
|
||||||
|
"gecko": {
|
||||||
|
"id": "bilibili-subtitle@indiekky"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//background
|
||||||
|
manifest.background = {
|
||||||
|
type: "module",
|
||||||
|
scripts: [manifest.background.service_worker]
|
||||||
|
}
|
||||||
|
//写回文件
|
||||||
|
fs.writeFileSync('./dist/manifest.json', JSON.stringify(manifest, null, 2))
|
||||||
|
|
||||||
|
console.log('fixFirefox.js done');
|
@@ -7,9 +7,10 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build_chrome": "tsc && vite build -m production_chrome && pnpm run fixChrome",
|
"build": "tsc && vite build -m production_chrome",
|
||||||
"fix": "eslint --fix --quiet .",
|
"build_chrome": "pnpm run build && node fixChrome.cjs",
|
||||||
"fixChrome": "node fixChrome.cjs"
|
"build_firefox": "pnpm run build && node fixFirefox.cjs",
|
||||||
|
"fix": "eslint --fix --quiet ."
|
||||||
},
|
},
|
||||||
"author": "IndieKKY",
|
"author": "IndieKKY",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
Reference in New Issue
Block a user