V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Get Google Chrome
Vimium · 在 Chrome 里使用 vim 快捷键
zpfhbyx
V2EX  ›  Chrome

大佬们,问个 chrome 插件的问题..

  •  
  •   zpfhbyx · 2019-01-31 17:45:49 +08:00 · 2393 次点击
    这是一个创建于 1904 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

    一调用 chrome.storage.local 就报这个...配了 N 个,还是不行...求解决..

    5 条回复    2019-02-18 09:38:28 +08:00
    napsterwu
        1
    napsterwu  
       2019-01-31 18:00:44 +08:00 via iPhone
    js 和 html 文件分开
    zpfhbyx
        2
    zpfhbyx  
    OP
       2019-01-31 18:03:38 +08:00
    @napsterwu js 有个单独的文件夹,难道要加载远程?
    napsterwu
        3
    napsterwu  
       2019-01-31 18:23:43 +08:00 via iPhone
    1. html 里面不能有 js 代码
    2. 要有的话,要改 manifest.json,参考别人 vuejs 开发扩展的配置
    zpfhbyx
        4
    zpfhbyx  
    OP
       2019-01-31 18:24:53 +08:00
    @napsterwu 好的,我去看看,谢谢
    IdontWanToBeBan
        5
    IdontWanToBeBan  
       2019-02-18 09:38:28 +08:00
    说个可能有安全隐患的办法= =
    装个 CSP 禁用插件
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5656 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 01:51 · PVG 09:51 · LAX 18:51 · JFK 21:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.