Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/typoAppIntegration.js

Issue 29366656: Issue 4683 - URL Fixer breaks location bar input when disabled (Closed) Base URL: https://hg.adblockplus.org/urlfixer
Patch Set: Do not modify urlbar variable Created Dec. 1, 2016, 2:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/typoAppIntegration.js
===================================================================
--- a/lib/typoAppIntegration.js
+++ b/lib/typoAppIntegration.js
@@ -111,18 +111,21 @@ switch (application)
exports.getBrowser = (window) => "gBrowser" in window ? window.gBrowser : null;
exports.applyToWindow = function(window, corrector)
{
let urlbar = exports.getURLBar(window);
if (urlbar && urlbar.handleCommand && !functionHooks.has(window))
{
+ let hooked = (urlbar.hasOwnProperty("handleCommand") ?
+ urlbar : Object.getPrototypeOf(urlbar));
Wladimir Palant 2016/12/01 14:02:43 Actually, with urlbar variable being used to acces
+
// Handle new URLs being entered
- let unhook = hook(urlbar, "handleCommand", function()
+ let unhook = hook(hooked, "handleCommand", function()
{
let correction = corrector(window, urlbar.value);
if (correction)
urlbar.value = correction;
});
functionHooks.set(window, unhook);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld