From f5f81df2c24cb82d306b239026cc4ce70efa9129 Mon Sep 17 00:00:00 2001 From: Noah Tilton Date: Sun, 24 Jul 2016 18:53:56 -0500 Subject: [PATCH] Code path to check for and abort if doc.domain is blacklisted Also added an entry field to the preferences. Each line represents a regex that will be applied against doc.domain. If the regex matches, IAT will abort. --- src/chrome/content/itsalltext.js | 1 + src/chrome/content/monitor.js | 27 +++++++++++++++++++++++-- src/chrome/content/preferences.xul | 8 ++++++++ src/chrome/locale/en-US/preferences.dtd | 1 + 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/chrome/content/itsalltext.js b/src/chrome/content/itsalltext.js index 4d7d14d..f620c25 100644 --- a/src/chrome/content/itsalltext.js +++ b/src/chrome/content/itsalltext.js @@ -119,6 +119,7 @@ var ItsAllText = function () { extensions: 'Char', hotkey: 'Char', tracker_id: 'Char', + blacklist_domains: 'Char', }, /** diff --git a/src/chrome/content/monitor.js b/src/chrome/content/monitor.js index b2b7af0..c90a433 100644 --- a/src/chrome/content/monitor.js +++ b/src/chrome/content/monitor.js @@ -252,10 +252,33 @@ Monitor.prototype.isHTML = function (doc) { is_html = (contentType == 'text/html' || contentType == 'text/xhtml' || contentType == 'application/xhtml+xml'); + + var blacklisted_domains = itsalltext.preferences.blacklist_domains.split("\n"); + var pattern, + domain_is_blacklisted = false; + for(var i=0, len=blacklisted_domains.length; i + @@ -124,6 +126,12 @@ + + diff --git a/src/chrome/locale/en-US/preferences.dtd b/src/chrome/locale/en-US/preferences.dtd index 7b7ab24..829f42c 100644 --- a/src/chrome/locale/en-US/preferences.dtd +++ b/src/chrome/locale/en-US/preferences.dtd @@ -14,3 +14,4 @@ +