Hello. In the process of developing, I faced a next problem.
I’ve created an add-on: 1) manifest.json:
{
“manifest_version”: 2,
“name”: “Example”,
“version”: “1.0”,
“description”: “Example”,
“permissions”: [
“tabs”,
“webRequest”,
“webRequestBlocking”,
“<all_urls>”
],
“icons”: {
“48”: “icon.png”
},
“background”: {
“scripts”: [
“background.js”
]
},
“applications”: {
“gecko”: {
“id”: "my-example@ex.com",
“strict_min_version”: “52.0”
}
}
}
-
background.js:
console.log("The first message ");
browser.webRequest.onBeforeRequest.addListener(
cancelReq,
{ urls: ["<all_urls>"], types: [“main_frame”] },
[“blocking”]
);function cancelReq(details) {
console.log("Details: " + JSON.stringify(details));
return { cancel: true };
}
Now, I click on the link, e.g ‘http://www.google.com/’ when Firefox is closed. 1 out of 10 times on average Firefox is opened and the first URL is not fired.
I see the console:
…
16:02:44.750 Something… (It depends on the link page.)
…
16:02:45.491 The first message
…
Is there any way to always get this event?