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

Side by Side Diff: lib/typoAppIntegration.js

Issue 8788183: Detect and handle the case of our own typo correction extension being installed in parallel (Closed)
Patch Set: Created Nov. 20, 2012, 9:53 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 let {hook} = require("hooks"); 5 let {hook} = require("hooks");
6 let {application, addonName} = require("info"); 6 let {application, addonName} = require("info");
7 7
8 let functionHooks = new WeakMap(); 8 let functionHooks = new WeakMap();
9 9
10 exports.removeFromWindow = function(window) 10 exports.removeFromWindow = function(window)
11 { 11 {
12 if (functionHooks.has(window)) 12 if (functionHooks.has(window))
13 { 13 {
14 let unhook = functionHooks.get(window); 14 let unhook = functionHooks.get(window);
15 unhook(); 15 unhook();
16 functionHooks.delete(window); 16 functionHooks.delete(window);
17 } 17 }
18
19 require("typoBootstrap").cleanup();
18 }; 20 };
19 21
20 switch (addonName) 22 switch (addonName)
21 { 23 {
22 case "url-fixer": 24 case "url-fixer":
23 { 25 {
24 // URL Fixer 26 // URL Fixer
25 exports.isTypoCorrectionEnabled = function(window, prefix, domain, suffix) t rue; 27 exports.isTypoCorrectionEnabled = function(window, prefix, domain, suffix) t rue;
26 28
27 break; 29 break;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 }; 358 };
357 359
358 break; 360 break;
359 } 361 }
360 default: 362 default:
361 { 363 {
362 exports.isKnownWindow = function(window) false; 364 exports.isKnownWindow = function(window) false;
363 break; 365 break;
364 } 366 }
365 } 367 }
OLDNEW
« no previous file with comments | « lib/main.js ('k') | lib/typoBootstrap.js » ('j') | lib/typoBootstrap.js » ('J')

Powered by Google App Engine
This is Rietveld