0

在 Vivaldi 浏览器上安装我的扩展程序后,我发现 id(来源)与 Chrome 不同。这是预期的行为?

请求标头 chrome 扩展来源

我的manifest.json

{
    "manifest_version": 2,
    "default_locale": "en",
    "short_name": "Intelligent Speaker",
    "name": "Text to speech that brings productivity",
    "description": "__MSG_appDesc__",
    "homepage_url": "https://intelligent-speaker.com",
    "content_security_policy": "default-src 'self'; img-src *; media-src https://intelligent-speaker.com https://intelligentspeaker.s3.amazonaws.com blob:; connect-src https://intelligentspeaker.auth.us-east-1.amazoncognito.com https://intelligent-speaker.com/voice-preview/ https://mjqj47yt17.execute-api.us-east-1.amazonaws.com https://api.intelligent-speaker.com https://intelligentspeaker.s3.amazonaws.com; style-src https://fonts.googleapis.com; font-src https://fonts.gstatic.com/;",
    "permissions": [
        "storage",
        "activeTab",
        "contextMenus"
    ],
    "offline_enabled": true,
    "version": "2018.10.12.1214",
    "browser_action": {
        "default_icon": {
            "128": "images/logo/logo128.png"
        },
        "default_popup": "popup.html"
    },
    "icons": {
        "128": "images/logo/logo128.png"
    },
    "background": {
        "page": "eventPage.html",
        "persistent": false
    },
    "author": "Intelligent Speaker",
    "incognito": "not_allowed",
    "container": "GOOGLE_DRIVE",
    "minimum_chrome_version": "60"
}
4

1 回答 1

1

您的插件作为具有临时 ID 的插件加载。这意味着浏览器可以决定插件 ID,因为您没有指定一个。这就是为什么你最终会得到不同的临时插件 ID(为了安全起见,它应该是随机的。)

在 Firefox 中,您可以像这样指定插件 ID:

"applications": {
    "gecko": {
      "id": "addonid@domain.org"
    }
}

但是,内部 id 仍可能用于 Origin 标头和文件 URL。不用担心,这样做是为了安全。

于 2018-10-12T18:17:53.950 回答