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

Delta Between Two Patch Sets: lib/typoAppIntegration.js

Issue 29366656: Issue 4683 - URL Fixer breaks location bar input when disabled (Closed) Base URL: https://hg.adblockplus.org/urlfixer
Left Patch Set: Created Dec. 1, 2016, 1:50 p.m.
Right Patch Set: Do not modify urlbar variable Created Dec. 1, 2016, 2:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of the URL Fixer, 2 * This file is part of the URL Fixer,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * URL Fixer is free software: you can redistribute it and/or modify 5 * URL Fixer is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * URL Fixer is distributed in the hope that it will be useful, 9 * URL Fixer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 exports.getURLBar = (window) => "gURLBar" in window ? window.gURLBar : null; 110 exports.getURLBar = (window) => "gURLBar" in window ? window.gURLBar : null;
111 111
112 exports.getBrowser = (window) => "gBrowser" in window ? window.gBrowser : nu ll; 112 exports.getBrowser = (window) => "gBrowser" in window ? window.gBrowser : nu ll;
113 113
114 exports.applyToWindow = function(window, corrector) 114 exports.applyToWindow = function(window, corrector)
115 { 115 {
116 let urlbar = exports.getURLBar(window); 116 let urlbar = exports.getURLBar(window);
117 if (urlbar && urlbar.handleCommand && !functionHooks.has(window)) 117 if (urlbar && urlbar.handleCommand && !functionHooks.has(window))
118 { 118 {
119 if (!urlbar.hasOwnProperty("handleCommand")) 119 let hooked = (urlbar.hasOwnProperty("handleCommand") ?
120 urlbar = Object.getPrototypeOf(urlbar); 120 urlbar : Object.getPrototypeOf(urlbar));
Wladimir Palant 2016/12/01 14:02:43 Actually, with urlbar variable being used to acces
121 121
122 // Handle new URLs being entered 122 // Handle new URLs being entered
123 let unhook = hook(urlbar, "handleCommand", function() 123 let unhook = hook(hooked, "handleCommand", function()
124 { 124 {
125 let correction = corrector(window, urlbar.value); 125 let correction = corrector(window, urlbar.value);
126 if (correction) 126 if (correction)
127 urlbar.value = correction; 127 urlbar.value = correction;
128 }); 128 });
129 functionHooks.set(window, unhook); 129 functionHooks.set(window, unhook);
130 } 130 }
131 }; 131 };
132 132
133 exports.openInfobar = function(window, id, message, buttons, persistence) 133 exports.openInfobar = function(window, id, message, buttons, persistence)
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 }; 372 };
373 373
374 break; 374 break;
375 } 375 }
376 default: 376 default:
377 { 377 {
378 exports.isKnownWindow = (window) => false; 378 exports.isKnownWindow = (window) => false;
379 break; 379 break;
380 } 380 }
381 } 381 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld