diff --git a/ChangeLog.md b/ChangeLog.md index 5008e311..5b74085e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -16,6 +16,9 @@ Note: ChangeLogs for the source code and unit tests, both not relevant for * view-source CSS file (#788) * NoScript icon for blocked flash content (#788) * pluginproblem URI (#797, #788) + * Add-on compatibility: + * NewsFox showed a redirection notification when clicking on a + news' title (#707) * Browser compatibility: * Firefox Accounts (#687) * updated translations diff --git a/src/content/lib/request-processor.compat.js b/src/content/lib/request-processor.compat.js index 71ea24e2..5f7aa911 100644 --- a/src/content/lib/request-processor.compat.js +++ b/src/content/lib/request-processor.compat.js @@ -40,6 +40,7 @@ let {Logger} = importModule("lib/logger"); RequestProcessor = (function(self) { let conflictingExtensions = []; let compatibilityRules = []; + let whitelistedBaseURIs = new Map(); let topLevelDocTranslationRules = {}; // TODO: update compatibility rules etc. when addons are enabled/disabled @@ -121,6 +122,11 @@ RequestProcessor = (function(self) { Logger.info(Logger.TYPE_INTERNAL, "Conflicting extension: " + ext.name); compatibilityRules.push( ["resource://brief-content/", null, ext.name]); + if (ext.id === "{899DF1F8-2F43-4394-8315-37F6744E6319}") { + // NewsFox + whitelistedBaseURIs.set("chrome://newsfox/content/newsfox.xul", + ext.name); + } conflictingExtensions.push({ "id": ext.id, "name": ext.name, @@ -365,6 +371,10 @@ RequestProcessor = (function(self) { return compatibilityRules; }; + self.getWhitelistedBaseURIs = function() { + return whitelistedBaseURIs; + }; + self.getConflictingExtensions = function() { return conflictingExtensions; }; diff --git a/src/content/lib/request-processor.jsm b/src/content/lib/request-processor.jsm index aad02c56..d6b2dcd3 100644 --- a/src/content/lib/request-processor.jsm +++ b/src/content/lib/request-processor.jsm @@ -894,6 +894,19 @@ var RequestProcessor = (function() { } } + if (request.aContext) { + let whitelistedBaseURIs = self.getWhitelistedBaseURIs(); + let baseURI = request.aContext.baseURI; + if (whitelistedBaseURIs.has(baseURI)) { + request.requestResult = new RequestResult(true, + REQUEST_REASON_COMPATIBILITY); + let extName = whitelistedBaseURIs.get(baseURI); + return accept( + "Extension/application compatibility rule matched [" + extName + + "]", request, true); + } + } + // If the destination has a mapping (i.e. it was originally a different // destination but was changed into the current one), accept this // request if the original destination would have been accepted.