mirror of
https://github.com/davegallant/rfd-redirect-stripper.git
synced 2025-08-05 08:13:40 +00:00
* 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
24 lines
512 B
JavaScript
24 lines
512 B
JavaScript
import { updateRedirects, setDefaultConfig } from "../js/utils.js"
|
|
|
|
function setAlarm() {
|
|
chrome.alarms.get('update-redirects', alarm => {
|
|
if (!alarm) {
|
|
chrome.alarms.create('update-redirects', { periodInMinutes: 60 });
|
|
}
|
|
});
|
|
}
|
|
|
|
chrome.alarms.onAlarm.addListener(() => {
|
|
updateRedirects();
|
|
});
|
|
|
|
chrome.runtime.onInstalled.addListener(() => {
|
|
setDefaultConfig();
|
|
updateRedirects();
|
|
setAlarm();
|
|
});
|
|
|
|
//Ensure alarm is created
|
|
chrome.runtime.onStartup.addListener(() => {
|
|
setAlarm();
|
|
}); |