mirror of
https://github.com/wassname/mad.git
synced 2026-06-29 16:30:31 +08:00
28 lines
647 B
JavaScript
28 lines
647 B
JavaScript
var blockChecker,
|
|
blockList,
|
|
blockService;
|
|
|
|
blockService = BlockListFactory.getBlockList();
|
|
blockService.set(DefaultList);
|
|
blockList = blockService.get();
|
|
console.log(blockList);
|
|
|
|
console.log("did background.js load properly");
|
|
blockChecker = new BlockCheck(DefaultList);
|
|
|
|
var currTabs = []; //TODO bugfix
|
|
var prevSite = "";
|
|
|
|
chrome.webRequest.onBeforeRequest.addListener(
|
|
function(details) {
|
|
// console.log("Is this evenf ucking working details.url: " + details.url);
|
|
// console.log(details);
|
|
prevSite = blockChecker.getUrl();
|
|
return blockChecker.redirectOnMatch(details);
|
|
},
|
|
{
|
|
urls: ["<all_urls>"]
|
|
},
|
|
["blocking"]
|
|
);
|