Introducing settingsl ibrary

This commit is contained in:
tobimori 2020-03-15 19:21:04 +01:00
parent 61f4ece730
commit 5f79be04bf
4 changed files with 20 additions and 10 deletions

View File

@ -43,5 +43,5 @@ browser.webRequest.onBeforeRequest.addListener(
browser.browserAction.onClicked.addListener((tab) => {
browser.browserAction.setBadgeText({text: "ON", tabId: tab.id});
console.log(tab.url);
});
}
);

2
lib.js
View File

@ -14,4 +14,4 @@ const removeElements = (...arrays) => {
[...arrays].forEach(([...array]) => array.filter(n => !!n)
.forEach(n => n.remove())
);
}
};

View File

@ -19,7 +19,7 @@
},
"background": {
"scripts": ["lib.js", "background.js"]
"scripts": ["lib.js", "settingslib.js", "background.js"]
},
"browser_action": {
@ -56,7 +56,7 @@
"*://*.ostsee-zeitung.de/*",
"*://*.paz-online.de/*",
"*://*.sn-online.de/*"],
"js": ["lib.js", "components/madsack.js"],
"js": ["lib.js", "settingslib.js", "components/madsack.js"],
"run_at": "document_end"
}, {
"matches": [
@ -64,13 +64,13 @@
"*://*.rundschau-online.de/*",
"*://*.mz-web.de/*"
],
"js": ["lib.js", "components/dumont.js"],
"js": ["lib.js", "settingslib.js", "components/dumont.js"],
"run_at": "document_idle"
}, {
"matches": [
"*://*.saarbruecker-zeitung.de/*"
],
"js": ["lib.js", "components/saarbruecker-zeitung.js"],
"js": ["lib.js", "settingslib.js", "components/saarbruecker-zeitung.js"],
"run_at": "document_idle"
}, {
"matches": [
@ -90,13 +90,13 @@
"*://*.usinger-anzeiger.de/*",
"*://*.wormser-zeitung.de/*"
],
"js": ["lib.js", "components/laterpay-vrm.js"],
"js": ["lib.js", "settingslib.js", "components/laterpay-vrm.js"],
"run_at": "document_start"
}, {
"matches": [
"*://*.nahverkehrhamburg.de/*"
],
"js": ["lib.js", "components/nahverkehrhamburg.js"],
"js": ["lib.js", "settingslib.js", "components/nahverkehrhamburg.js"],
"run_at": "document_idle"
}, {
"matches": [
@ -106,7 +106,7 @@
"*://*.muensterlandzeitung.de/*",
"*://*.halternerzeitung.de/*"
],
"js": ["lib.js", "components/lensingmedia.js"],
"js": ["lib.js", "settingslib.js", "components/lensingmedia.js"],
"run_at": "document_end"
}
]

10
settingslib.js Normal file
View File

@ -0,0 +1,10 @@
// ____
// __ _____ ___ ___ ___ ___ _____ _/ / /
// / // / _ \/ _ \/ _ `/ // / |/|/ / _ `/ / /
// \_,_/_//_/ .__/\_,_/\_, /|__,__/\_,_/_/_/
// /_/ /___/
//
// settings library
// github.com/tobimori/unpaywall
//