[Pkg-mozext-commits] [requestpolicy] 235/280: [refact] remove unused, obsolete functions

David Prévot taffit at moszumanska.debian.org
Sat May 2 20:30:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit cb7367da4020c9c9dd30f605d00a035ef9795ca6
Author: Martin Kimmerle <dev at 256k.de>
Date:   Thu Mar 19 10:43:57 2015 +0100

    [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 5738afd..a4854ad 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 4a884c3..85605e1 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 0bb92ae..4231106 100644
--- a/src/content/ui/overlay.js
+++ b/src/content/ui/overlay.js
@@ -767,17 +767,6 @@ requestpolicy.overlay = (function() {
   };
 
   /**
-   * 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()
    * - openLinkInPrivateWindow()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list