Chrome和Vivaldi的ID是否不同?

时间:2018-10-12 09:08:35

标签: google-chrome-extension firefox-webextensions vivaldi

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

request headers chrome extension origin

我的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"
}

1 个答案:

答案 0 :(得分:1)

您的插件被加载为具有临时ID的插件。这意味着浏览器可以确定附加组件ID,因为您没有指定附加组件ID。这就是为什么您使用不同的临时插件ID(出于安全性考虑,它应该是随机的)的原因。

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

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

但是,内部ID仍可用于Origin标头和文件URL。不用担心,这是出于安全性考虑。