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

Side by Side 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: Created Dec. 1, 2016, 1:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"))
120 urlbar = Object.getPrototypeOf(urlbar);
121
119 // Handle new URLs being entered 122 // Handle new URLs being entered
120 let unhook = hook(urlbar, "handleCommand", function() 123 let unhook = hook(urlbar, "handleCommand", function()
121 { 124 {
122 let correction = corrector(window, urlbar.value); 125 let correction = corrector(window, urlbar.value);
123 if (correction) 126 if (correction)
124 urlbar.value = correction; 127 urlbar.value = correction;
125 }); 128 });
126 functionHooks.set(window, unhook); 129 functionHooks.set(window, unhook);
127 } 130 }
128 }; 131 };
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 }; 372 };
370 373
371 break; 374 break;
372 } 375 }
373 default: 376 default:
374 { 377 {
375 exports.isKnownWindow = (window) => false; 378 exports.isKnownWindow = (window) => false;
376 break; 379 break;
377 } 380 }
378 } 381 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld