Skip to content

Commit 5c8bc3f

Browse files
committed
Initial commit
0 parents  commit 5c8bc3f

8 files changed

+1524
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Addon.zip
2+
Makefile
3+
main.js
4+
node_modules
5+

addon.png

2.39 KB
Loading

configure

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
npm i
2+
3+
printf "all:\n" > Makefile
4+
printf "\twebpack && zip Addon manifest.json main.js addon.png\n" >> Makefile
5+
6+

index.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const acorn = require('acorn/dist/acorn_loose.js')
2+
browser.webRequest.onBeforeRequest.addListener(request => {
3+
return new Promise((resolve, reject) => {
4+
fetch(request.url)
5+
.then(res => res.text())
6+
.then(text => {
7+
console.log(acorn.parse_dammit(text))
8+
resolve({ cancel: false })
9+
})
10+
})
11+
}, { types: ['script'], urls: ["<all_urls>"] }, ['blocking'])

manifest.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manifest_version": 2,
3+
"name": "LibreJS Test",
4+
"version": "0.0.1",
5+
"background": {
6+
"scripts": ["main.js"],
7+
"persistent": true
8+
},
9+
"icons": {
10+
"48": "addon.png"
11+
},
12+
"permissions": ["<all_urls>", "webRequest", "webRequestBlocking"]
13+
}

0 commit comments

Comments
 (0)