diff --git a/html/options.html b/html/options.html
index 8be39c2..6cb00fe 100644
--- a/html/options.html
+++ b/html/options.html
@@ -52,7 +52,7 @@
: | (Default: enabled; show changelog page when ScriptSafe is updated) |
Hotkeys: | Configure the ScriptSafe hotkeys (click on "Keyboard Shortcuts") |
Privacy Settings |
- : | (Default: disabled; block allowed domains on unknown tabs) |
+ : | (Default: disabled; block allowed domains on unlisted domains) |
: | (Default: enabled; remove unwanted content from known ad / malware domains; domains gathered from MVPS HOSTS, hpHOSTS (ad / tracking servers), Peter Lowe's HOSTS Project, MalwareDomainList.com) |
: | (Default: enabled; blocks cookies from known ad / malware domains; below mode applies to this as well) |
: | (Default: -Unchanged-; modifies how all links are opened) |
- : | (Default: disabled; preserve same-domain elements) |
+ : | (Default: Disabled; preserve same-domain elements) |
: | (Default: enabled; auto-refresh page after list change) |
: | (Default: enabled; if ticked, adds rating button under domains in tab popup) |
: | (Default: disabled; if ticked, closes tab options everytime an option is clicked) |
diff --git a/html/updated.html b/html/updated.html
index 43629e9..717b089 100644
--- a/html/updated.html
+++ b/html/updated.html
@@ -8,24 +8,21 @@
-
Updated to v! (Thursday, June 9, 2016)
+
Updated to v! (Friday, June 10, 2016)
In this version you will find the following updates:
- - v1.0.7.9:
+ - v1.0.7.10:
- Announcement: changes to ScriptSafe updates
- - Significant performance increase, due to improved list checking (how significant? Check it out!)
- - Added new option: Paranoia Mode - block allowed domains on unknown tabs (default: disabled)
- - Feel free to enable this option for added security, and uncheck if you prefer to browse without it
- - This is disabled by default as it changes how ScriptSafe behaves up until now
- - I personally recommend enabling it
+ - Important compatibility fix for ScriptSafe to work in Chrome-derivative browsers
+ - Added more granularity for the Respect Same-Domain option. The three options are now:
+ - Disabled
+ - Strict - allow same domain only
+ - Loose - allow same domain and subdomains (this was the behaviour if Respect Same-Domain was enabled in the past)
- - Smart grouping of domains in the panel based on parent domain
- - Added support for recognizing and filtering new tab pages
- - Minor fixes to hotkey function, options page, and panel
- - Better distinction between webbugs and images
+ - Better inline element removal
- Updated unwanted content providers list
diff --git a/js/options.js b/js/options.js
index 996f369..35a4308 100644
--- a/js/options.js
+++ b/js/options.js
@@ -128,7 +128,7 @@ function loadOptions() {
loadElement("annoyancesmode");
loadCheckbox("antisocial");
loadCheckbox("webbugs");
- loadCheckbox("preservesamedomain");
+ loadElement("preservesamedomain");
loadCheckbox("paranoia");
loadCheckbox("classicoptions");
loadCheckbox("referrer");
@@ -172,7 +172,7 @@ function saveOptions() {
saveElement("annoyancesmode");
saveCheckbox("antisocial");
saveCheckbox("webbugs");
- saveCheckbox("preservesamedomain");
+ saveElement("preservesamedomain");
saveCheckbox("paranoia");
saveCheckbox("classicoptions");
saveCheckbox("referrer");
diff --git a/js/popup.js b/js/popup.js
index a50e512..ff941e6 100644
--- a/js/popup.js
+++ b/js/popup.js
@@ -152,7 +152,7 @@ function init() {
undesirablecount++;
} else if ((parentstatus == '1' || parentstatus == '-1') && domainCheckStatus == '0') {
$("#blocked [rel='x_"+itemdomainfriendly+"'] .box1, #blocked [rel='x_"+itemdomainfriendly+"'] .x_trust, #blocked [rel='x_"+itemdomainfriendly+"'] .box3, #blocked [rel='x_"+itemdomainfriendly+"'] .box4").hide();
- $("#blocked [rel='x_"+itemdomainfriendly+"'] .x_blacklist").attr("title","Ignored allowed domain due to unknown tab domain").html("Ignored Allow").addClass("selected");
+ $("#blocked [rel='x_"+itemdomainfriendly+"'] .x_blacklist").attr("title","Ignored allowed domain due to unlisted tab domain").html("Ignored Allow").addClass("selected");
} else if (response.annoyances == 'true' && domainCheckStatus == '-1' && baddiesstatus == '1') {
$("#blocked [rel='x_"+itemdomainfriendly+"'] .x_"+itemdomainfriendly).hide();
$("#blocked [rel='x_"+itemdomainfriendly+"'] .x_blacklist").attr("title","Unwanted Content Provider").html("Unwanted").addClass("selected");
@@ -171,7 +171,7 @@ function init() {
}
}
}
- $("#blocked").append($('.thirditem:has([title="Ignored allowed domain due to unknown tab domain"])'));
+ $("#blocked").append($('.thirditem:has([title="Ignored allowed domain due to unlisted tab domain"])'));
$("#blocked").append($('.thirditem:has([title="Unwanted Content Provider"])'));
$("#blocked").append($('.thirditem:has([title="Antisocial"])'));
$("#blocked").append($('.thirditem:not(*>:has(.choices))'));
diff --git a/js/scriptsafe.js b/js/scriptsafe.js
index 0d03d14..8327a18 100644
--- a/js/scriptsafe.js
+++ b/js/scriptsafe.js
@@ -9,7 +9,7 @@ var version = (function () {
var requestTypes, synctimer, blackList, whiteList, distrustList, trustList, sessionBlackList, sessionWhiteList;
var popup = [];
var changed = false;
-const ITEMS = {};
+var ITEMS = {};
var experimental = 0;
var storageapi = false;
function refreshRequestTypes() {
@@ -176,7 +176,8 @@ function ScriptSafe(req) {
elementStatusCheck = true;
thirdPartyCheck = true;
} else {
- if (domainCheckStatus == '0' && !(tabDomainCheckStatus == '-1' && localStorage['mode'] == 'block' && localStorage['paranoia'] == 'true')) thirdPartyCheck = false;
+ if ((domainCheckStatus == '0' && !(tabDomainCheckStatus == '-1' && localStorage['mode'] == 'block' && localStorage['paranoia'] == 'true')) || (localStorage['preservesamedomain'] == 'strict' && extractedDomain == extractedReqDomain)) thirdPartyCheck = false;
+ else if (localStorage['preservesamedomain'] == 'strict' && extractedDomain != extractedReqDomain) thirdPartyCheck = true;
else thirdPartyCheck = thirdParty(req.url, extractedDomain);
if ((tabDomainCheckStatus == '-1' && localStorage['mode'] == 'block' && localStorage['paranoia'] == 'true') || (domainCheckStatus != '0' && (domainCheckStatus == '1' || (domainCheckStatus == '-1' && localStorage['mode'] == 'block'))) || ((localStorage['annoyances'] == 'true' && (localStorage['annoyancesmode'] == 'strict' || (localStorage['annoyancesmode'] == 'relaxed' && domainCheckStatus != '0'))) && baddiesCheck == '1') || (localStorage['antisocial'] == 'true' && baddiesCheck == '2'))
elementStatusCheck = true;
@@ -188,7 +189,7 @@ function ScriptSafe(req) {
} else {
return { cancel: false };
}
- if (elementStatusCheck && ((localStorage['preservesamedomain'] == 'true' && (thirdPartyCheck || domainCheckStatus == '1' || baddiesCheck)) || localStorage['preservesamedomain'] == 'false')) {
+ if (elementStatusCheck && ((localStorage['preservesamedomain'] != 'false' && (thirdPartyCheck || domainCheckStatus == '1' || baddiesCheck)) || localStorage['preservesamedomain'] == 'false')) {
if (typeof ITEMS[req.tabId]['blocked'] === 'undefined') ITEMS[req.tabId]['blocked'] = [];
if (!UrlInList(removeParams(req.url), ITEMS[req.tabId]['blocked'])) {
if (extractedReqDomain.substr(0,4) == 'www.') extractedReqDomain = extractedReqDomain.substr(4);
@@ -422,8 +423,8 @@ function setDefaultOptions() {
chrome.browserAction.setBadgeBackgroundColor({color:[208, 0, 24, 255]});
}
function updateCount(tabId) {
- const TAB_ITEMS = ITEMS[tabId] || (ITEMS[tabId] = [0]);
- const TAB_BLOCKED_COUNT = ++TAB_ITEMS[0];
+ var TAB_ITEMS = ITEMS[tabId] || (ITEMS[tabId] = [0]);
+ var TAB_BLOCKED_COUNT = ++TAB_ITEMS[0];
chrome.browserAction.setBadgeBackgroundColor({ color: [208, 0, 24, 255], tabId: tabId });
chrome.browserAction.setBadgeText({tabId: tabId, text: TAB_BLOCKED_COUNT + ''});
}
@@ -543,7 +544,7 @@ chrome.extension.onConnect.addListener(function(port) {
});
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
if (request.reqtype == 'get-settings') {
- sendResponse({status: localStorage['enable'], enable: enabled(sender.tab.url), experimental: experimental, mode: localStorage['mode'], annoyancesmode: localStorage['annoyancesmode'], antisocial: localStorage['antisocial'], whitelist: whiteList, blacklist: blackList, whitelistSession: sessionWhiteList, blackListSession: sessionBlackList, script: localStorage['script'], noscript: localStorage['noscript'], object: localStorage['object'], applet: localStorage['applet'], embed: localStorage['embed'], iframe: localStorage['iframe'], frame: localStorage['frame'], audio: localStorage['audio'], video: localStorage['video'], image: localStorage['image'], annoyances: localStorage['annoyances'], preservesamedomain: localStorage['preservesamedomain'], webbugs: localStorage['webbugs'], referrer: localStorage['referrer'], linktarget: localStorage['linktarget']});
+ sendResponse({status: localStorage['enable'], enable: enabled(sender.tab.url), experimental: experimental, mode: localStorage['mode'], annoyancesmode: localStorage['annoyancesmode'], antisocial: localStorage['antisocial'], whitelist: whiteList, blacklist: blackList, whitelistSession: sessionWhiteList, blackListSession: sessionBlackList, script: localStorage['script'], noscript: localStorage['noscript'], object: localStorage['object'], applet: localStorage['applet'], embed: localStorage['embed'], iframe: localStorage['iframe'], frame: localStorage['frame'], audio: localStorage['audio'], video: localStorage['video'], image: localStorage['image'], annoyances: localStorage['annoyances'], preservesamedomain: localStorage['preservesamedomain'], webbugs: localStorage['webbugs'], referrer: localStorage['referrer'], linktarget: localStorage['linktarget'], paranoia: localStorage['paranoia']});
if (typeof ITEMS[sender.tab.id] === 'undefined') {
resetTabData(sender.tab.id, sender.tab.url);
} else {
@@ -568,11 +569,15 @@ chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
} else if (request.reqtype == 'update-blocked') {
if (request.src) {
if (typeof ITEMS[sender.tab.id]['blocked'] === 'undefined') ITEMS[sender.tab.id]['blocked'] = [];
- if (!UrlInList(removeParams(request.src), ITEMS[sender.tab.id]['blocked'])) {
+ if (!UrlInList(removeParams(request.src), ITEMS[sender.tab.id]['blocked']) || request.node == 'NOSCRIPT') {
var extractedDomain = extractDomainFromURL(request.src);
if (extractedDomain.substr(0,4) == 'www.') extractedDomain = extractedDomain.substr(4);
var extractedTabDomain = extractDomainFromURL(ITEMS[sender.tab.id]['url']);
- ITEMS[sender.tab.id]['blocked'].push([removeParams(request.src), request.node, extractedDomain, domainCheck(request.src, 1), domainCheck(extractedTabDomain, 1), baddies(request.src, localStorage['annoyancesmode'], localStorage['antisocial'], 2)]);
+ if (request.node == 'NOSCRIPT') {
+ ITEMS[sender.tab.id]['blocked'].push([request.src, request.node, request.src, '-1', '-1', false]);
+ } else {
+ ITEMS[sender.tab.id]['blocked'].push([removeParams(request.src), request.node, extractedDomain, domainCheck(request.src, 1), domainCheck(extractedTabDomain, 1), baddies(request.src, localStorage['annoyancesmode'], localStorage['antisocial'], 2)]);
+ }
updateCount(sender.tab.id);
}
}
diff --git a/js/ss.js b/js/ss.js
index 43b9dbe..a5a2f0c 100644
--- a/js/ss.js
+++ b/js/ss.js
@@ -28,7 +28,8 @@ var SETTINGS = {
"WEBBUGS": true,
"LINKTARGET": "off",
"EXPERIMENTAL": "0",
- "REFERRER": true
+ "REFERRER": true,
+ "PARANOIA": 'true'
};
const reStartWProtocol = /^[^\.\/:]+:\/\//i; // credit: NotScripts
function block(event) {
@@ -36,6 +37,7 @@ function block(event) {
var elSrc = getElSrc(el);
if (!elSrc) return;
var elType = el.nodeName.toUpperCase();
+ if (!(elType == "A" || elType == "IFRAME" || elType == "FRAME" || (elType == "SCRIPT" && SETTINGS['EXPERIMENTAL'] == '0') || elType == "EMBED" || elType == "OBJECT" || elType == "IMG")) return;
elSrc = elSrc.toLowerCase();
var thirdPartyCheck;
var elementStatusCheck;
@@ -44,20 +46,22 @@ function block(event) {
var elWidth = $(el).attr('width');
var elHeight = $(el).attr('height');
var elStyle = $(el).attr('style');
- var baddiesCheck = baddies(absoluteUrl, localStorage['annoyancesmode'], localStorage['antisocial']);
- if (SETTINGS['DOMAINSTATUS'] == '1') {
+ var baddiesCheck = baddies(absoluteUrl, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL']);
+ if (SETTINGS['DOMAINSTATUS'] == '1' || (SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true' && SETTINGS['PRESERVESAMEDOMAIN'] == 'false')) {
elementStatusCheck = true;
thirdPartyCheck = true;
domainCheckStatus = '1';
} else {
domainCheckStatus = domainCheck(absoluteUrl, 1);
- if (domainCheckStatus == '0') thirdPartyCheck = false;
+ var elementDomain = extractDomainFromURL(absoluteUrl);
+ if ((domainCheckStatus == '0' && !(SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true')) || (SETTINGS['PRESERVESAMEDOMAIN'] == 'strict' && elementDomain == window.location.hostname)) thirdPartyCheck = false;
+ else if (SETTINGS['PRESERVESAMEDOMAIN'] == 'strict' && elementDomain != window.location.hostname) thirdPartyCheck = true;
else thirdPartyCheck = thirdParty(absoluteUrl);
- if ((domainCheckStatus != '0' && (domainCheckStatus == '1' || (domainCheckStatus == '-1' && SETTINGS['MODE'] == 'block'))) || ((SETTINGS['ANNOYANCES'] == 'true' && (SETTINGS['ANNOYANCESMODE'] == 'strict' || (SETTINGS['ANNOYANCESMODE'] == 'relaxed' && domainCheckStatus != '0'))) && baddiesCheck == '1') || (SETTINGS['ANTISOCIAL'] == 'true' && baddiesCheck == '2'))
+ if ((SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true') || (domainCheckStatus != '0' && (domainCheckStatus == '1' || (domainCheckStatus == '-1' && SETTINGS['MODE'] == 'block'))) || ((SETTINGS['ANNOYANCES'] == 'true' && (SETTINGS['ANNOYANCESMODE'] == 'strict' || (SETTINGS['ANNOYANCESMODE'] == 'relaxed' && domainCheckStatus != '0'))) && baddiesCheck == '1') || (SETTINGS['ANTISOCIAL'] == 'true' && baddiesCheck == '2'))
elementStatusCheck = true;
else elementStatusCheck = false;
}
- if (elSrc.substr(0,17) != 'chrome-extension:' && (elType == "A" || elType == "IFRAME" || elType == "FRAME" || (elType == "SCRIPT" && SETTINGS['EXPERIMENTAL'] == '0') || elType == "EMBED" || elType == "OBJECT" || elType == "IMG") && elementStatusCheck && (
+ if (elSrc.substr(0,17) != 'chrome-extension:' && elementStatusCheck && (
(
(
(
@@ -72,7 +76,7 @@ function block(event) {
|| (elType == "A" && SETTINGS['REFERRER'] == 'true')
)
&& (
- (SETTINGS['PRESERVESAMEDOMAIN'] == 'true' && (thirdPartyCheck || domainCheckStatus == '1' || baddiesCheck))
+ (SETTINGS['PRESERVESAMEDOMAIN'] != 'false' && (thirdPartyCheck || domainCheckStatus == '1' || baddiesCheck))
|| SETTINGS['PRESERVESAMEDOMAIN'] == 'false'
)
@@ -98,7 +102,8 @@ function block(event) {
elType = "WEBBUG";
}
chrome.extension.sendRequest({reqtype: "update-blocked", src: absoluteUrl, node: elType});
- $(el).remove();
+ if (elType == 'VIDEO' || elType == 'AUDIO') removeMedia($el);
+ else $(el).remove();
}
} else {
if (SETTINGS['EXPERIMENTAL'] == '0' && elSrc.substr(0,11) != 'javascript:' && elSrc.substr(0,17) != 'chrome-extension:' && (elType == "IFRAME" || elType == "FRAME" || elType == "EMBED" || elType == "OBJECT" || elType == "SCRIPT")) {
@@ -106,52 +111,28 @@ function block(event) {
}
}
}
-function postLoadCheck(el) {
- var elSrc = getElSrc(el);
- if (!elSrc) return false;
- elSrc = elSrc.toLowerCase();
- var thirdPartyCheck;
+function postLoadCheck(elSrc) {
var domainCheckStatus;
- var absoluteUrl = relativeToAbsoluteUrl(elSrc);
- if (SETTINGS['DOMAINSTATUS'] == '1') {
- domainCheckStatus = '1';
+ var thirdPartyCheck;
+ var elementStatusCheck;
+ var baddiesCheck = baddies(elSrc, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL'], 2);
+ if (SETTINGS['DOMAINSTATUS'] == '1' || (SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true' && SETTINGS['PRESERVESAMEDOMAIN'] == 'false')) {
+ elementStatusCheck = true;
thirdPartyCheck = true;
} else {
- domainCheckStatus = domainCheck(absoluteUrl, 1);
- if (domainCheckStatus == '0') thirdPartyCheck = false;
- else thirdPartyCheck = thirdParty(absoluteUrl);
+ domainCheckStatus = domainCheck(elSrc, 1);
+ var elementDomain = extractDomainFromURL(elSrc);
+ if ((domainCheckStatus == '0' && !(SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true')) || (SETTINGS['preservesamedomain'] == 'strict' && elementDomain == window.location.hostname)) thirdPartyCheck = false;
+ else if (SETTINGS['preservesamedomain'] == 'strict' && elementDomain != window.location.hostname) thirdPartyCheck = true;
+ else thirdPartyCheck = thirdParty(elSrc);
+ if ((SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true') || (domainCheckStatus != '0' && (domainCheckStatus == '1' || (domainCheckStatus == '-1' && SETTINGS['MODE'] == 'block'))) || ((SETTINGS['ANNOYANCES'] == 'true' && (SETTINGS['ANNOYANCESMODE'] == 'strict' || (SETTINGS['ANNOYANCESMODE'] == 'relaxed' && domainCheckStatus != '0'))) && baddiesCheck == '1') || (SETTINGS['ANTISOCIAL'] == 'true' && baddiesCheck == '2'))
+ elementStatusCheck = true;
+ else elementStatusCheck = false;
}
- if (elSrc.substr(0,17) != 'chrome-extension:' && elementStatus(absoluteUrl, SETTINGS['MODE']) && (((SETTINGS['PRESERVESAMEDOMAIN'] == 'true' && (thirdPartyCheck || domainCheckStatus == '1')) || SETTINGS['PRESERVESAMEDOMAIN'] == 'false')))
+ if (elementStatusCheck && ((SETTINGS['PRESERVESAMEDOMAIN'] != 'false' && (thirdPartyCheck || domainCheckStatus == '1' || baddiesCheck)) || SETTINGS['PRESERVESAMEDOMAIN'] == 'false'))
return true;
return false;
}
-function fallbackRemover(tag) {
- var elements = document.getElementsByTagName(tag);
- for (var i = 0; i < elements.length; i++) {
- var elSrc = getElSrc(elements[i]);
- if (elSrc) {
- elSrc = elSrc.toLowerCase();
- var domainCheckStatus;
- var thirdPartyCheck;
- var absoluteUrl = relativeToAbsoluteUrl(elSrc);
- if (SETTINGS['DOMAINSTATUS'] == '1') {
- domainCheckStatus = '1';
- thirdPartyCheck = true;
- } else {
- domainCheckStatus = domainCheck(absoluteUrl, 1);
- if (domainCheckStatus == '0') thirdPartyCheck = false;
- else thirdPartyCheck = thirdParty(absoluteUrl);
- }
- if (elementStatus(absoluteUrl, SETTINGS['MODE']) && ((SETTINGS['PRESERVESAMEDOMAIN'] == 'true' && (thirdPartyCheck || domainCheckStatus == '1')) || SETTINGS['PRESERVESAMEDOMAIN'] == 'false')) {
- if (elements[i].src) elements[i].src = "";
- if (elements[i].parentNode) elements[i].parentNode.removeChild(elements[i]);
- chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: tag});
- } else {
- chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: tag});
- }
- }
- }
-}
function domainCheck(domain, req) {
if (!domain) return '-1';
if (req === undefined) {
@@ -170,15 +151,8 @@ function domainCheck(domain, req) {
}
return '-1';
}
-function elementStatus(src, mode, taburl) {
- if (taburl === undefined) taburl = window.location.hostname;
- else taburl = extractDomainFromURL(taburl);
- var domainCheckStatus = domainCheck(src);
- if (src.substring(0,4) == 'javascript:' && domainCheckStatus != '0' && (domainCheckStatus == '1' || (domainCheckStatus == '-1' && mode == 'block'))) return true;
- return false;
-}
function relativeToAbsoluteUrl(url) { // credit: NotScripts
- if (!url)
+ if (!url || url.indexOf('://') != -1)
return url;
if (url[0] == '/' && url[1] == '/')
return document.location.protocol + url;
@@ -193,41 +167,60 @@ function blockreferrer() {
$("a[rel!='noreferrer']").each(function() {
var elSrc = getElSrc(this);
if (elSrc) {
- elSrc = elSrc.toLowerCase();
+ elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase());
var domainCheckStatus;
var thirdPartyCheck;
- var absoluteUrl = relativeToAbsoluteUrl(elSrc);
- if (SETTINGS['DOMAINSTATUS'] == '1') {
- domainCheckStatus = '1';
+ var elementStatusCheck;
+ var baddiesCheck = baddies(elSrc, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL'], 2);
+ if (SETTINGS['DOMAINSTATUS'] == '1' || (SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true' && SETTINGS['PRESERVESAMEDOMAIN'] == 'false')) {
+ elementStatusCheck = true;
thirdPartyCheck = true;
} else {
- domainCheckStatus = domainCheck(absoluteUrl, 1);
- if (domainCheckStatus == '0') thirdPartyCheck = false;
- else thirdPartyCheck = thirdParty(absoluteUrl);
+ domainCheckStatus = domainCheck(elSrc, 1);
+ var elementDomain = extractDomainFromURL(elSrc);
+ if ((domainCheckStatus == '0' && !(SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true')) || (SETTINGS['preservesamedomain'] == 'strict' && elementDomain == window.location.hostname)) thirdPartyCheck = false;
+ else if (SETTINGS['preservesamedomain'] == 'strict' && elementDomain != window.location.hostname) thirdPartyCheck = true;
+ else thirdPartyCheck = thirdParty(elSrc);
+ if ((SETTINGS['DOMAINSTATUS'] == '-1' && SETTINGS['MODE'] == 'block' && SETTINGS['PARANOIA'] == 'true') || (domainCheckStatus != '0' && (domainCheckStatus == '1' || (domainCheckStatus == '-1' && SETTINGS['MODE'] == 'block'))) || ((SETTINGS['ANNOYANCES'] == 'true' && (SETTINGS['ANNOYANCESMODE'] == 'strict' || (SETTINGS['ANNOYANCESMODE'] == 'relaxed' && domainCheckStatus != '0'))) && baddiesCheck == '1') || (SETTINGS['ANTISOCIAL'] == 'true' && baddiesCheck == '2'))
+ elementStatusCheck = true;
+ else elementStatusCheck = false;
}
- if (thirdPartyCheck && domainCheckStatus != '0') {
+ if (elementStatusCheck && ((SETTINGS['PRESERVESAMEDOMAIN'] != 'false' && (thirdPartyCheck || domainCheckStatus == '1' || baddiesCheck)) || SETTINGS['PRESERVESAMEDOMAIN'] == 'false'))
$(this).attr("rel","noreferrer");
- }
}
});
}
+function removeMedia($el) {
+ $el[0].pause();
+ $el[0].src = '';
+ $el.children('source').prop('src', '');
+ $el.load();
+ //$el.hide();
+ $el.remove().length = 0;
+};
function ScriptSafe() {
if (SETTINGS['LINKTARGET'] != 'off') {
var linktrgt;
if (SETTINGS['LINKTARGET'] == 'same') linktrgt = '_self';
else if (SETTINGS['LINKTARGET'] == 'new') linktrgt = '_blank';
- $("a").attr("target", linktrgt);
+ $("a[target!='"+linktrgt+"']").attr("target", linktrgt);
}
if (SETTINGS['NOSCRIPT'] == 'true') {
- $("noscript").each(function() { chrome.extension.sendRequest({reqtype: "update-blocked", src: $(this).html(), node: 'NOSCRIPT'}); $(this).hide(); }); // hiding instead of removing as removing seems to periodically crash tabs. Not a huge loss as the listener script should filter any inserted content (e.g. iframes, webbugs).
+ $("noscript").each(function() { chrome.extension.sendRequest({reqtype: "update-blocked", src: $(this).html(), node: 'NOSCRIPT'}); $(this).remove(); });
}
- if (SETTINGS['APPLET'] == 'true') $("applet").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = elSrc.toLowerCase(); if (postLoadCheck(this)) { chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: 'APPLET'}); $(this).remove(); } else { chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: 'APPLET'}); } } });
- if (SETTINGS['VIDEO'] == 'true') fallbackRemover("VIDEO"); // jquery can't select and beforeload doesn't catch video/audio tags :(
- if (SETTINGS['AUDIO'] == 'true') fallbackRemover("AUDIO"); // ^
+ if (SETTINGS['APPLET'] == 'true') $("applet").each(function() { var elSrc = $(this).attr('code'); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc.toLowerCase())) { chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: 'APPLET'}); $(this).remove(); } else { chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: 'APPLET'}); } } });
+ if (SETTINGS['VIDEO'] == 'true') $("video").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc); if (postLoadCheck(elSrc.toLowerCase())) { chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: 'VIDEO'}); removeMedia($(this)); } else { chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: 'VIDEO'}); } } });
+ if (SETTINGS['AUDIO'] == 'true') $("audio").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc); if (postLoadCheck(elSrc.toLowerCase())) { chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: 'AUDIO'}); removeMedia($(this)); } else { chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: 'AUDIO'}); } } });
+ /* handled by background page, but clean up elements */
+ if (SETTINGS['IFRAME'] == 'true') $("iframe").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc)) { $(this).remove(); } } });
+ if (SETTINGS['OBJECT'] == 'true') $("object").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc)) { $(this).remove(); } } });
+ if (SETTINGS['EMBED'] == 'true') $("embed").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc)) { $(this).remove(); } } });
+ if (SETTINGS['IMAGE'] == 'true') $("picture").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc)) { $(this).remove(); } } });
+ if (SETTINGS['IMAGE'] == 'true') $("img").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc)) { $(this).remove(); } } });
if (SETTINGS['SCRIPT'] == 'true' && SETTINGS['EXPERIMENTAL'] == '0') {
clearUnloads();
- $("script").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = elSrc.toLowerCase(); if (postLoadCheck(this)) { chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: 'SCRIPT'}); $(this).remove(); } else { if (elSrc.substr(0,11) != 'javascript:' && elSrc.substr(0,17) != 'chrome-extension:') { chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: "SCRIPT"}); } } } });
- if ((SETTINGS['PRESERVESAMEDOMAIN'] == 'false' || (SETTINGS['PRESERVESAMEDOMAIN'] == 'true' && SETTINGS['DOMAINSTATUS'] == '1'))) {
+ $("script").each(function() { var elSrc = getElSrc(this); if (elSrc) { elSrc = relativeToAbsoluteUrl(elSrc.toLowerCase()); if (postLoadCheck(elSrc)) { chrome.extension.sendRequest({reqtype: "update-blocked", src: elSrc, node: 'SCRIPT'}); $(this).remove(); } else { if (elSrc.substr(0,11) != 'javascript:' && elSrc.substr(0,17) != 'chrome-extension:') { chrome.extension.sendRequest({reqtype: "update-allowed", src: elSrc, node: "SCRIPT"}); } } } });
+ if ((SETTINGS['PRESERVESAMEDOMAIN'] == 'false' || (SETTINGS['PRESERVESAMEDOMAIN'] != 'false' && SETTINGS['DOMAINSTATUS'] == '1'))) {
$("a[href^='javascript']").attr("href","javascript:;");
$("[onClick]").removeAttr("onClick");
$("[onAbort]").removeAttr("onAbort");
@@ -264,6 +257,37 @@ function loaded() {
}
function getElSrc(el) {
switch (el.nodeName.toUpperCase()) {
+ case 'PICTURE':
+ var plist = el.getElementsByTagName('source');
+ for (var i=0; i < plist.length; i++) {
+ if (plist[i].srcset) return plist[i].srcset;
+ }
+ plist = el.getElementsByTagName('img');
+ for (var i=0; i < plist.length; i++) {
+ if (plist[i].src) return plist[i].src;
+ }
+ return window.location.href;
+ break;
+ case 'AUDIO':
+ if (el.src) {
+ if (reStartWProtocol.test(el.src)) return el.src;
+ }
+ var plist = el.getElementsByTagName('source');
+ for (var i=0; i < plist.length; i++) {
+ if (plist[i].src) return plist[i].src;
+ }
+ return window.location.href;
+ break;
+ case 'VIDEO':
+ if (el.src) {
+ if (reStartWProtocol.test(el.src)) return el.src;
+ }
+ var plist = el.getElementsByTagName('source');
+ for (var i=0; i < plist.length; i++) {
+ if (plist[i].src) return plist[i].src;
+ }
+ return window.location.href;
+ break;
case 'OBJECT': // credit: NotScripts
if (el.codeBase) codeBase = el.codeBase;
if (el.data) {
@@ -297,15 +321,9 @@ function getElSrc(el) {
}
return window.location.href;
break;
- case 'APPLET':
- return el.code;
- break;
case 'A':
return el.href;
break;
- case 'PARAM':
- return el.value;
- break;
default:
return el.src;
break;
@@ -401,7 +419,7 @@ chrome.extension.sendRequest({reqtype: "get-settings", iframe: iframe}, function
SETTINGS['PRESERVESAMEDOMAIN'] = response.preservesamedomain;
SETTINGS['EXPERIMENTAL'] = response.experimental;
SETTINGS['DOMAINSTATUS'] = domainCheck(window.location.href, 1);
- if (SETTINGS['EXPERIMENTAL'] == '0' && (((SETTINGS['PRESERVESAMEDOMAIN'] == 'false' || (SETTINGS['PRESERVESAMEDOMAIN'] == 'true' && SETTINGS['DOMAINSTATUS'] == '1')) && response.enable == 'true' && SETTINGS['SCRIPT'] == 'true' && SETTINGS['DOMAINSTATUS'] != '0') || ((SETTINGS['ANNOYANCES'] == 'true' && (SETTINGS['ANNOYANCESMODE'] == 'strict' || (SETTINGS['ANNOYANCESMODE'] == 'relaxed' && SETTINGS['DOMAINSTATUS'] != '0')) && baddies(window.location.hostname, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL']) == '1') || (SETTINGS['ANTISOCIAL'] == 'true' && baddies(window.location.hostname, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL']) == '2'))))
+ if (SETTINGS['EXPERIMENTAL'] == '0' && (((SETTINGS['PRESERVESAMEDOMAIN'] == 'false' || (SETTINGS['PRESERVESAMEDOMAIN'] != 'false' && SETTINGS['DOMAINSTATUS'] == '1')) && response.enable == 'true' && SETTINGS['SCRIPT'] == 'true' && SETTINGS['DOMAINSTATUS'] != '0') || ((SETTINGS['ANNOYANCES'] == 'true' && (SETTINGS['ANNOYANCESMODE'] == 'strict' || (SETTINGS['ANNOYANCESMODE'] == 'relaxed' && SETTINGS['DOMAINSTATUS'] != '0')) && baddies(window.location.hostname, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL']) == '1') || (SETTINGS['ANTISOCIAL'] == 'true' && baddies(window.location.hostname, SETTINGS['ANNOYANCESMODE'], SETTINGS['ANTISOCIAL']) == '2'))))
mitigate();
SETTINGS['LISTSTATUS'] = response.enable;
SETTINGS['NOSCRIPT'] = response.noscript;
@@ -416,9 +434,13 @@ chrome.extension.sendRequest({reqtype: "get-settings", iframe: iframe}, function
SETTINGS['WEBBUGS'] = response.webbugs;
SETTINGS['LINKTARGET'] = response.linktarget;
SETTINGS['REFERRER'] = response.referrer;
- document.addEventListener("beforeload", block, true);
- for (var i = 0; i < savedBeforeloadEvents.length; i++)
- block(savedBeforeloadEvents[i]);
+ SETTINGS['PARANOIA'] = response.paranoia;
+ if (SETTINGS['LISTSTATUS'] == 'true') {
+ document.addEventListener("beforeload", block, true);
+ for (var i = 0; i < savedBeforeloadEvents.length; i++)
+ block(savedBeforeloadEvents[i]);
+ ScriptSafe();
+ }
}
delete savedBeforeloadEvents;
});
diff --git a/js/yoyo.js b/js/yoyo.js
index 6f2fba8..7d5d57f 100644
--- a/js/yoyo.js
+++ b/js/yoyo.js
@@ -3110,7 +3110,6 @@ var yoyo1 = [
'errornuker.com',
'ertya.com',
'escalatenetwork.com',
-'esdcoach.de',
'esellerate.net',
'esomniture.com',
'espdesign.com.au',
@@ -3119,6 +3118,7 @@ var yoyo1 = [
'estat.com',
'esther-munsey.us',
'esther-strauss.us',
+'et-code.ru',
'etahub.com',
'etargetnet.com',
'eternitymobiles.com',
@@ -4749,6 +4749,7 @@ var yoyo1 = [
'lowes-pianos-and-organs.com',
'loxtk.com',
'lsawards.com',
+'luceinveneto.com',
'luchtenbergdecor.com.br',
'lucidmedia.com',
'luciole.co.uk',
@@ -5862,7 +5863,6 @@ var yoyo1 = [
'platinumbucks.com',
'platsovetrf.ru',
'play2mobi.com',
-'play44.net',
'play4traffic.com',
'playertraffic.com',
'playhaven.com',
@@ -28065,6 +28065,7 @@ var yoyo2 = [
'advantedges.go2cloud.org',
'advdl.ammadv.it',
'adveng.hiasys.com',
+'advent.mkofoed.dk',
'adventize.go2cloud.org',
'adverserve.austriacomplus.at',
'advert.ananzi.co.za',
@@ -28587,6 +28588,7 @@ var yoyo2 = [
'aimtoday.aol.com',
'aio.lp.mydas.mobi',
'aircrafte.bernhard-rau.de',
+'airplane.mm-sos.com',
'airpushmarketing.s3.amazonaws.com',
'ais.abacast.com',
'aj.600z.com',
@@ -36209,6 +36211,7 @@ var yoyo2 = [
'crackberry.us.intellitxt.com',
'crain.d1.sc.omtrdc.net',
'crd1.bannerbank.ru',
+'cream.mobtu.tk',
'create.leadid.com',
'createthegroup.122.2o7.net',
'creative.360yield.com',
@@ -40213,6 +40216,7 @@ var yoyo2 = [
'grafix.xxxcounter.com',
'grammarly.go2cloud.org',
'granite.bnex.com',
+'granular.matorral.cl',
'graphics.cams.com',
'graphics.friendfinder.com',
'graphics.medleyads.com',
@@ -40367,6 +40371,7 @@ var yoyo2 = [
'hardsextube-bud.gravityrd-services.com',
'hardwaregeeks.us.intellitxt.com',
'hardwarezone.us.intellitxt.com',
+'harmon.markhamgreens.ca',
'harmony-central.us.intellitxt.com',
'harpo.122.2o7.net',
'harrahscom.112.2o7.net',
@@ -41434,6 +41439,7 @@ var yoyo2 = [
'imgcache.classesusa.com',
'imgcache.vmsn.de',
'imgcdn.nrelate.com',
+'imgg.adskeeper.co.uk',
'imgg.dt07.net',
'imgg.marketgid.com',
'imgg.steepto.com',
@@ -46646,6 +46652,7 @@ var yoyo2 = [
'popme.163.com',
'popoholic.us.intellitxt.com',
'poponthepop.us.intellitxt.com',
+'popovo.mclegend.tk',
'pops.ero-advertising.com',
'pops.freeze.com',
'pops.velmedia.net',
@@ -47679,6 +47686,7 @@ var yoyo2 = [
'reports.superfish.com',
'reports.wes.df.telemetry.microsoft.com',
'reports.zedo.com',
+'reprimand.lukashotary.sk',
'reprox01.dus.local.vmsn.de',
'republika.onet.pl',
'req.adsmogo.com',
@@ -49248,6 +49256,7 @@ var yoyo2 = [
'slbbbcom.112.2o7.net',
'sleep.vermontteddybear.com',
'slider.plugrush.com',
+'slight.localmusicmovement.com',
'slimxxxtubeacn.dnset.com',
'slimxxxtubealn.ddns.name',
'slimxxxtubeanr.ddns.name',
@@ -51350,6 +51359,7 @@ var yoyo2 = [
'thomasvillefurniture.122.2o7.net',
'thome.112.2o7.net',
'thoughtsmedia.us.intellitxt.com',
+'thread.martinpascal.cl',
'threadwatch.us.intellitxt.com',
'threepillarsattorneys.vtgbackstage.com',
'thriftless.tinhocxd.com',
@@ -52874,6 +52884,7 @@ var yoyo2 = [
'upload.zedo.com',
'uploads.tmweb.ru',
'uponor.otistores.com',
+'upper.lucianelgi.ro',
'upsoj.iptvdeals.com',
'upstart.88vid.com',
'upstats.yadro.ru',
diff --git a/manifest.json b/manifest.json
index a87049d..18cc5ba 100644
--- a/manifest.json
+++ b/manifest.json
@@ -47,5 +47,5 @@
"options_page": "html/options.html",
"permissions": [ "http://*/*", "https://*/*", "tabs", "unlimitedStorage", "webRequest", "webRequestBlocking", "storage", "notifications" ],
"update_url": "http://clients2.google.com/service/update2/crx",
- "version": "1.0.7.9"
+ "version": "1.0.7.10"
}