0

How force (or request in installation) WebExtension update on start browser?

In Firefox I need click in this option:

Firefox

In Opera I need click in this button:

enter image description here

What I want to know is if there is any way to check using the API if there is any update or configure "manifest.json" to do this.

I need add autoupdate to Opera, Firefox and Chrome.

My current manifest.json (Firefox):

{
    "name": "Name",
    "version": "0.0.1",
    "manifest_version": 2,
    "description": "Description",
    "applications": {
        "gecko": {
            "id": "xxxxxxxxx@xxxxxxxxx.org",
            "strict_min_version": "45.0"
        }
    },
    "browser_action": {
        "default_icon": "images/icon.png",
        "default_popup": "popup.html"
    },
    "background": {
        "scripts": [
            "background.js"
        ]
    },
    "icons": {
        "128": "images/icon-128px.png",
        "48":  "images/icon-48px.png",
        "32":  "images/icon-32px.png",
        "16":  "images/icon.png"
    }
}
Protomen
  • 9,471
  • 9
  • 57
  • 124

1 Answers1

0

For chrome extension, you could use chrome.runtime.requestUpdateCheck to request an immediate update check, and please be aware of the following important tips.

Important: Most extensions/apps should not use this method, since chrome already does automatic checks every few hours, and you can listen for the runtime.onUpdateAvailable event without needing to call requestUpdateCheck.

This method is only appropriate to call in very limited circumstances, such as if your extension/app talks to a backend service, and the backend service has determined that the client extension/app version is very far out of date and you'd like to prompt a user to update. Most other uses of requestUpdateCheck, such as calling it unconditionally based on a repeating timer, probably only serve to waste client, network, and server resources.

Community
  • 1
  • 1
Haibara Ai
  • 10,703
  • 2
  • 31
  • 47