Sunday, July 10, 2022
HomeWeb DevelopmentHow you can Get Extension Manifest Data

How you can Get Extension Manifest Data


Engaged on an internet extension may be kinda wild — on one facet you are primarily simply coding a web site, on the opposite facet you are restricted to what the browser says you are able to do within the extension execution atmosphere. One change in that atmosphere is coming January 2023 — pushing extensions to maneuver to manifest model 3. I just lately bought inquisitive about whether or not different fashionable extensions had accomplished the model 3 replace.

Executing the next command within the background web page (manifest model 2) or service employee (model 3) will present you the extension’s manifest:

chrome.runtime.getManifest()

The getManifest name returns a big object detailing the extension’s manifest. This is what you’d see for the MetaMask browser extension:

{
    "writer": "https://metamask.io",
    "background": {
        "web page": "background.html",
        "persistent": true
    },
    "browser_action": {
        "default_icon": {
            "16": "photos/icon-16.png",
            "19": "photos/icon-19.png",
            "32": "photos/icon-32.png",
            "38": "photos/icon-38.png",
            "64": "photos/icon-64.png",
        },
        "default_popup": "popup.html",
        "default_title": "MetaMask"
    },
    "instructions": {
        "_execute_browser_action": {
            "suggested_key": {
                "chromeos": "Alt+Shift+M",
                "linux": "Alt+Shift+M",
                "mac": "Alt+Shift+M",
                "home windows": "Alt+Shift+M"
            }
        }
    },
    "content_scripts": [
        {
            "all_frames": true,
            "js": [
                "disable-console.js",
                "globalthis.js",
                "lockdown-install.js",
                "lockdown-run.js",
                "lockdown-more.js",
                "contentscript.js"
            ],
            "matches": [
                "file://*/*",
                "http://*/*",
                "https://*/*"
            ],
            "run_at": "document_start"
        }
    ],
    "current_locale": "en_US",
    "default_locale": "en",
    "description": "An Ethereum Pockets in your Browser",
    "externally_connectable": {
        "ids": [
            "*"
        ],
        "matches": [
            "https://metamask.io/*"
        ]
    },
    "icons": {
        "16": "photos/icon-16.png",
        "19": "photos/icon-19.png",
        "32": "photos/icon-32.png",
        "38": "photos/icon-38.png",
        "48": "photos/icon-48.png",
        "64": "photos/icon-64.png",
    },
    "manifest_version": 2,
    "minimum_chrome_version": "66",
    "title": "MetaMask",
    "permissions": [
        "storage",
        "unlimitedStorage",
        "clipboardWrite",
        "http://localhost:8545/",
        "https://*.infura.io/",
        "https://lattice.gridplus.io/*",
        "activeTab",
        "webRequest",
        "*://*.eth/",
        "notifications"
    ],
    "short_name": "MetaMask",
    "update_url": "https://clients2.google.com/service/update2/crx",
    "model": "10.16.1"
}

Lots of net extensions are nonetheless utilizing manifest model 2, so many extension builders are pushing to complete manifest model 3 work!


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments