无法通过 Firefox 扩展中的 CDN 文件使用 Vue JS

问题描述 投票:0回答:0

我正在尝试创建一个 Firefox 扩展并在 Vue JS 中准备好它。我正在使用来自here

的 Vue JS 的 Production CDN 版本

这就是我的 manifest.json 的样子:

{
"name": "This is a test",
"description": "Test",
"version": "1.0.0",
"manifest_version": 2,
"browser_action": {
    "browser_style": true,
    "default_title": "This is a test"
},
"permissions": ["tabs", "activeTab", "https://test.com/*"],
"background": {
    "scripts": ["./js/background.js"]
},
"content_scripts": [
    {
        "matches": ["*://*.test.com/*", "*://test.com/*"],
        "run_at": "document_end",
        "all_frames": false,
        "js": ["./js/contentscript.js"]
    }
],
"icons": {
    "48": "./images/logo.png"
},
"browser_specific_settings": {
    "gecko": {
        "id": "[email protected]",
        "strict_min_version": "98.0"
    }
}

当我尝试在 Firefox 中导入它时,收到错误:内容安全策略:页面的设置阻止在 eval(“script-src”)处加载资源。在 vue.js 文件中。

我使用普通脚本标签将 vue.js 文件(从 vue 网站下载)导入到 index.html 文件中。

我正在尝试创建一个 Firefox 扩展并在 Vue JS 中准备好它。我正在使用来自here

的 Vue JS 的 Production CDN 版本

这就是我的 manifest.json 的样子:

{
"name": "This is a test",
"description": "Test",
"version": "1.0.0",
"manifest_version": 2,
"browser_action": {
    "browser_style": true,
    "default_title": "This is a test"
},
"permissions": ["tabs", "activeTab", "https://test.com/*"],
"background": {
    "scripts": ["./js/background.js"]
},
"content_scripts": [
    {
        "matches": ["*://*.test.com/*", "*://test.com/*"],
        "run_at": "document_end",
        "all_frames": false,
        "js": ["./js/contentscript.js"]
    }
],
"icons": {
    "48": "./images/logo.png"
},
"browser_specific_settings": {
    "gecko": {
        "id": "[email protected]",
        "strict_min_version": "98.0"
    }
}

当我尝试在 Firefox 中导入它时,收到错误:内容安全策略:页面的设置阻止在 eval(“script-src”)处加载资源。在 vue.js 文件中。

我使用普通脚本标签将 vue.js 文件(从 vue 网站下载)导入到 index.html 文件中。

javascript vue.js vuejs2 firefox-addon content-security-policy
© www.soinside.com 2019 - 2024. All rights reserved.