Add files for Mozilla API

This commit is contained in:
flying-scorpio 2020-01-05 10:03:43 +01:00
parent 37886f4da4
commit e7979f893c
2 changed files with 23 additions and 0 deletions

8
requests/backgroud.js Normal file
View file

@ -0,0 +1,8 @@
function logURL(requestDetails) {
console.log("Loading: " + requestDetails.url);
}
browser.webRequest.onBeforeRequest.addListener(
logURL,
{urls: ["<all_urls>"]}
);

15
requests/manifest.json Normal file
View file

@ -0,0 +1,15 @@
{
"description": "Demonstrating webRequests",
"manifest_version": 2,
"name": "webRequest-demo",
"version": "1.0",
"permissions": [
"webRequest",
"<all_urls>"
],
"background": {
"scripts": ["background.js"]
}
}