LEFT | RIGHT |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 let info = require("info"); | 63 let info = require("info"); |
64 let processScript = info.addonRoot + "lib/child/typoNetError.js?" + Math.random(
); | 64 let processScript = info.addonRoot + "lib/child/typoNetError.js?" + Math.random(
); |
65 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"] | 65 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"] |
66 .getService(Ci.nsIProcessScriptLoader) | 66 .getService(Ci.nsIProcessScriptLoader) |
67 .QueryInterface(Ci.nsIMessageListenerManager) | 67 .QueryInterface(Ci.nsIMessageListenerManager) |
68 .QueryInterface(Ci.nsIMessageBroadcaster); | 68 .QueryInterface(Ci.nsIMessageBroadcaster); |
69 messageManager.loadProcessScript(processScript, true); | 69 messageManager.loadProcessScript(processScript, true); |
70 | 70 |
71 onShutdown.add(() => { | 71 onShutdown.add(() => |
| 72 { |
72 messageManager.broadcastAsyncMessage("URLFixer:Shutdown", processScript); | 73 messageManager.broadcastAsyncMessage("URLFixer:Shutdown", processScript); |
73 messageManager.removeDelayedProcessScript(processScript); | 74 messageManager.removeDelayedProcessScript(processScript); |
74 }); | 75 }); |
75 | 76 |
76 messageManager.addMessageListener("URLFixer:GetNetErrorOverlay", | 77 messageManager.addMessageListener("URLFixer:GetNetErrorOverlay", |
77 getNetErrorOverlay); | 78 getNetErrorOverlay); |
78 messageManager.addMessageListener("URLFixer:UserCorrection", | 79 messageManager.addMessageListener("URLFixer:UserCorrection", |
79 processCorrection); | 80 processCorrection); |
80 onShutdown.add(() => { | 81 onShutdown.add(() => |
| 82 { |
81 messageManager.removeMessageListener("URLFixer:GetNetErrorOverlay", | 83 messageManager.removeMessageListener("URLFixer:GetNetErrorOverlay", |
82 getNetErrorOverlay); | 84 getNetErrorOverlay); |
83 messageManager.removeMessageListener("URLFixer:UserCorrection", | 85 messageManager.removeMessageListener("URLFixer:UserCorrection", |
84 processCorrection); | 86 processCorrection); |
85 }); | 87 }); |
LEFT | RIGHT |