The following web-extension code in my background script background.js works fine on Opera and Chrome triggering appropriate webpage on Install, Update and Uninstall but does nothing in firefox. The same is shown as compatible here - https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onInstalled
Manifest.json has:
"background" : {
"scripts" : ["includes/background.js"]
},
background.js has :
//CHECK INSTALL, UPDATE, UNINSTALL
chrome.runtime.onInstalled.addListener(function (details) {
if (details.reason == "install") {
chrome.tabs.create({
url : "https://www.example.com/install.html"
});
}
if (details.reason == "update") {
chrome.tabs.create({
url : "https://www.example.com/update.html"
});
}
});
chrome.runtime.setUninstallURL("http://www.example.com/uninstall.html");
There is no error in console, I am loading extension from about:debugging#addons
.
EDIT: Just found that removing addon from the about:addons
triggers the uninstall-page, still no luck with install and update trigger. Can it be the fact that Install
is not triggered when in Debug
mode!!