You've already forked bilibili-subtitle
fix csp
This commit is contained in:
@@ -51,6 +51,9 @@ node版本:18.15.0
|
||||
|
||||
注:`./push.sh`是作者自用脚本,可以忽略。
|
||||
|
||||
提示:本地edge开发调试可能有问题,会报csp错误!本地开发调试推荐用chrome。
|
||||
构建后应该正常,关键是fix.cjs里将use_dynamic_url设置为false的这个操作。
|
||||
|
||||
## 贡献指南
|
||||
|
||||
欢迎贡献代码或提出改进建议!如果您希望为该项目做出贡献,请遵循以下步骤:
|
||||
|
7
fix.cjs
7
fix.cjs
@@ -5,4 +5,11 @@ const fs = require('fs')
|
||||
//copy index.html to sidepanel.html
|
||||
fs.copyFileSync('./dist/index.html', './dist/sidepanel.html')
|
||||
|
||||
//set all use_dynamic_url to false
|
||||
const manifest = require('./dist/manifest.json')
|
||||
manifest.web_accessible_resources.forEach(resource => {
|
||||
resource.use_dynamic_url = false
|
||||
})
|
||||
fs.writeFileSync('./dist/manifest.json', JSON.stringify(manifest, null, 2))
|
||||
|
||||
console.log('fix.js done');
|
||||
|
@@ -57,7 +57,7 @@ export default defineManifest(async (env) => ({
|
||||
"resources": [
|
||||
"index.html",
|
||||
],
|
||||
"use_dynamic_url": true
|
||||
"use_dynamic_url": false
|
||||
}
|
||||
]
|
||||
}))
|
||||
|
Reference in New Issue
Block a user