block = true;
}
if (block) {
//httpChannel.cancel(Cr.NS_BINDING_ABORTED); //this aborts the load
httpChannel.redirectTo(Services.io.newURI('https://www.google.com/', null, null)); //can redirect with this line, if dont want to redirect and just block, then uncomment this line and comment out line above (line 17)
}
}
};
function extract_domain(url) {
var matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
return matches[1];
}
chrome.webRequest.onBeforeRequest.addListener(function(details) {
var domain = extract_domain(details.url);
return { cancel: AUTHORIZED_DOMAINS[domain ]===false };
}, {urls: ["<all_urls>"]},["blocking"]);})();
New Version 1.29 (Feb 26, 2017)Download - For compatibility error with old projects - CAPX
- [+] On Go to URL *(triggered when a new page load starts).
- [#] Get Host *(now returns only the hostname. eg: facebook, twitter, google...).
tokenat(tokenat(iFrame.URL, 1, "&q="), 0, "&")
~~~ in some cases ~~~
tokenat(tokenat(iFrame.URL, 1, "#q="), 0, "&")
Who is online |
Users browsing this forum: No registered users and 2 guests |