justjavac/ReplaceGoogleCDN

未能成功加载扩展程序

monicfenga opened this issue · 2 comments

步骤:

  1. 直接下载repo(master分支)
  2. 解压缩下载下来的扩展
  3. 打开已安装扩展界面
  4. 点击“加载已解压的扩展程序”
  5. 选择解压缩好的扩展
  6. 显示如下错误:
无法加载以下来源的扩展程序:ReplaceGoogleCDN
'content_security_policy.extension_pages': Insecure CSP value "'wasm-unsafe-eval'" in directive 'script-src'.

其下有个文本框,与之相关的地方为:

  "content_security_policy": {
    "extension_pages": "default-src 'self';script-src 'self'  'wasm-unsafe-eval'  ;object-src 'self'; style-src 'self' 'unsafe-inline' ; connect-src   https://justjavac.com https://justjavac.github.io https://*.justjavac.com/ https://*.jingjingxyk.com https://jingjingxyk.github.io  http://localhost https://raw.githubusercontent.com https://github.com https://gitee.com https://gitcode.net;",
    "sandbox": "sandbox allow-scripts allow-popups; script-src 'unsafe-inline' 'unsafe-eval'  "
  },

当我编辑对应文件“manifest.json”的“wasm-unsafe-eval”去掉后,可以安装,但显示错误(同时扩展的功能也完全用不了):

警告
'action' requires canary channel or newer, but this is the stable channel.


警告
'background.service_worker' requires dev channel or newer, but this is the stable channel.


警告
'host_permissions' requires dev channel or newer, but this is the stable channel.


警告
The maximum currently-supported manifest version is 2, but this is 3. Certain features may not work as expected.


警告
Permission 'declarativeNetRequestWithHostAccess' is unknown or URL pattern is malformed.


警告
rules_redirect_main.json: Rule with id 1 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_redirect_main.json: Rule with id 2 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_redirect_main.json: Rule with id 3 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_redirect_main.json: Rule with id 4 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_redirect_main.json: Rule with id 5 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_redirect_main.json: Too many rule parse failures; Reporting the first 5.


警告
rules_redirect_main_extra.json: Rule with id 1 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_remove_content_security_policy_header.json: Rule with id 1 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".


警告
rules_domain_replace.json: Rule with id 1 couldn't be parsed. Parse error: 'ResourceType': expected "main_frame" or "sub_frame" or "stylesheet" or "script" or "image" or "font" or "object" or "xmlhttprequest" or "ping" or "csp_report" or "media" or "websocket" or "other", got "webtransport".

环境信息

  • Windows 10 版本1809
  • 360极速浏览器版本 13.5.2044.0
  • Chromium内核版本 86.0.4240.198

请用v2 版本

v3 版本 需要chromium 内核 大于等于87 https://github.com/justjavac/ReplaceGoogleCDN/tree/master/extension/rules