mirror of
https://github.com/davegallant/rfd-redirect-stripper.git
synced 2025-08-07 00:58:14 +00:00
Add Chrome support (#15)
* add chrome support * fix alarms * Add tkqlhce.com (#12) * add tkqlhce.com * add match at beginning of regex * formatting * set config needs to come first * still need background.scripts for firefox * need full path * add onStartup listener to ensure alarm is created * set time to 60 * add manifest specific to chrome and bump version
This commit is contained in:
17
js/utils.js
17
js/utils.js
@@ -1,22 +1,25 @@
|
||||
function updateRedirects() {
|
||||
browser.storage.local.get("config", function (URL) {
|
||||
export function updateRedirects() {
|
||||
chrome.storage.local.get("config", function (URL) {
|
||||
fetch(URL.config)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
browser.storage.local
|
||||
chrome.storage.local
|
||||
.set({
|
||||
redirects: res,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function setDefaultConfig() {
|
||||
browser.storage.local.set({
|
||||
export function setDefaultConfig() {
|
||||
chrome.storage.local.set({
|
||||
config:
|
||||
"https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/redirects.json",
|
||||
"https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/redirects.json",
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user