From cb7367da4020c9c9dd30f605d00a035ef9795ca6 Mon Sep 17 00:00:00 2001 From: Martin Kimmerle Date: Thu, 19 Mar 2015 10:43:57 +0100 Subject: [PATCH] [refact] remove unused, obsolete functions resolves #233 --- src/content/lib/request-processor.jsm | 10 ----- src/content/lib/utils/domains.jsm | 59 --------------------------- src/content/ui/overlay.js | 11 ----- 3 files changed, 80 deletions(-) diff --git a/src/content/lib/request-processor.jsm b/src/content/lib/request-processor.jsm index 5738afd1..a4854ad2 100644 --- a/src/content/lib/request-processor.jsm +++ b/src/content/lib/request-processor.jsm @@ -890,16 +890,6 @@ let RequestProcessor = (function(self) { - self._printAllowedRequests = function() { - self._allowedRequests.print(); - }; - - self._printRejectedRequests = function() { - self._rejectedRequests.print(); - }; - - - diff --git a/src/content/lib/utils/domains.jsm b/src/content/lib/utils/domains.jsm index 4a884c39..85605e18 100644 --- a/src/content/lib/utils/domains.jsm +++ b/src/content/lib/utils/domains.jsm @@ -104,10 +104,6 @@ DomainUtil.getIdentifier = function(uri, level) { } }; -DomainUtil.identifierIsInUri = function(identifier, uri, level) { - return identifier == this.getIdentifier(uri, level); -}; - /** * Returns the hostname from a uri string. * @@ -231,65 +227,10 @@ DomainUtil.getPrePath = function(uri) { return this.getUriObject(uri).prePath; }; -/** - * Strips any "www." from the beginning of a hostname. - * - * @param {String} - * hostname The hostname to strip. - * @return {String} The hostname with any leading "www." removed. - */ -DomainUtil.stripWww = function(hostname) { - return hostname.indexOf('www.') == 0 ? hostname.substring(4) : hostname; -}; - -/** - * Determine if two hostnames are the same if any "www." prefix is ignored. - * - * @param {String} - * destinationHost The destination hostname. - * @param {String} - * originHost The origin hostname. - * @return {Boolean} True if the hostnames are the same regardless of "www.", - * false otherwise. - */ -DomainUtil.sameHostIgnoreWww = function(destinationHost, originHost) { - return destinationHost - && this.stripWww(destinationHost) == this.stripWww(originHost); - -}; - DomainUtil.stripFragment = function(uri) { return uri.split("#")[0]; }; -/** - * Determine if the destination hostname is a subdomain of the origin hostname, - * ignoring any "www." that may exist in the origin hostname. That is, - * "images.example.com" is subdomain of both "www.example.com" and - * "example.com", but "www.example.com " and "example.com" are not subdomains of - * "images.example.com". - * - * @param {String} - * destinationHost The destination hostname. - * @param {String} - * originHost The origin hostname. - * @return {Boolean} True if the destination hostname is a subdomain of the - * origin hostname. - */ -DomainUtil.destinationIsSubdomainOfOrigin = function(destinationHost, - originHost) { - var destHostNoWww = this.stripWww(destinationHost); - var originHostNoWww = this.stripWww(originHost); - - var lengthDifference = destHostNoWww.length - originHostNoWww.length; - if (lengthDifference > 1) { - if (destHostNoWww.substring(lengthDifference - 1) == '.' + originHostNoWww) { - return true; - } - } - return false; -}; - // TODO: Maybe this should have a different home. /** * Gets the relevant pieces out of a meta refresh or header refresh string. diff --git a/src/content/ui/overlay.js b/src/content/ui/overlay.js index 0bb92ae7..42311068 100644 --- a/src/content/ui/overlay.js +++ b/src/content/ui/overlay.js @@ -766,17 +766,6 @@ requestpolicy.overlay = (function() { /*requestpolicy.overlay._attachPopupToContextMenu();*/ }; - /** - * Called as an event listener when popuphidden fires on the - * contentAreaContextMenu. - */ - //_contextMenuOnPopupHidden : function(event) { - // if (event.currentTarget != event.originalTarget) { - // return; - // } - // /*requestpolicy.overlay._attachPopupToStatusbar();*/ - //}, - /** * Wraps (overrides) the following methods of gContextMenu * - openLink()