-
Notifications
You must be signed in to change notification settings - Fork 0
/
bg.js
29 lines (26 loc) · 763 Bytes
/
bg.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function redirectToThePast() {
var obama = "https://obamawhitehouse.archives.gov/";
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
return {redirectUrl: obama};
},
{
urls: [
"*://whitehouse.gov/*",
"*://www.whitehouse.gov/*"
],
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
},
["blocking"]
);
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.tabs.update({ url: obama });
});
}
chrome.storage.sync.get({
redirectDT: true
}, function(options) {
if (options.redirectDT) {
redirectToThePast();
}
});