mirror of
https://github.com/davegallant/rfd-redirect-stripper.git
synced 2025-08-08 17:42:28 +00:00
Add chrome extension source
This commit is contained in:
18
extensions/chrome/background.js
Normal file
18
extensions/chrome/background.js
Normal file
@@ -0,0 +1,18 @@
|
||||
function updateRedirects() {
|
||||
var URL =
|
||||
"https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/redirects.json";
|
||||
|
||||
fetch(URL)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
chrome.storage.local.set({
|
||||
"rfd-redirects": res,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
chrome.runtime.onInstalled.addListener(() => {
|
||||
updateRedirects();
|
||||
});
|
||||
|
||||
setInterval(updateRedirects, 1 * 60 * 60 * 1000);
|
Reference in New Issue
Block a user