Skip to content

Commit

Permalink
[refact] remove unused, obsolete functions
Browse files Browse the repository at this point in the history
resolves #233
  • Loading branch information
myrdd committed Mar 19, 2015
1 parent 7085cf4 commit cb7367d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 80 deletions.
10 changes: 0 additions & 10 deletions src/content/lib/request-processor.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -890,16 +890,6 @@ let RequestProcessor = (function(self) {



self._printAllowedRequests = function() {
self._allowedRequests.print();
};

self._printRejectedRequests = function() {
self._rejectedRequests.print();
};






Expand Down
59 changes: 0 additions & 59 deletions src/content/lib/utils/domains.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 0 additions & 11 deletions src/content/ui/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cb7367d

Please sign in to comment.