Search code examples
google-chrome-extensionfirefox-addon-webextensionsvivaldi

id is different for Chrome and Vivaldi?


After installing of my extension on Vivaldi browser I found that id (origin) is not the same as for Chrome. This is expected behaviour?

request headers chrome extension origin

My 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"
}

Solution

  • Your addon is loaded as an addon with a temporary id. This means the browser gets to decide the addon ID since you didn't specify one. That's why you end up with different temporary addon ids (it should be random for security.)

    In Firefox, you can specify an addon ID like this:

    "applications": {
        "gecko": {
          "id": "[email protected]"
        }
    }
    

    But still, the internal id might be used for Origin headers and file URLs. Don't worry about it, it's done for security.