| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus 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 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 { | 63 { |
| 64 onUpdate.inProgress = false; | 64 onUpdate.inProgress = false; |
| 65 apply(); | 65 apply(); |
| 66 }); | 66 }); |
| 67 } | 67 } |
| 68 | 68 |
| 69 function apply() | 69 function apply() |
| 70 { | 70 { |
| 71 unapply(); | 71 unapply(); |
| 72 | 72 |
| 73 if (!Prefs.enabled) |
| 74 return; |
| 75 |
| 73 try | 76 try |
| 74 { | 77 { |
| 75 Utils.styleService.loadAndRegisterSheet(styleURL, | 78 Utils.styleService.loadAndRegisterSheet(styleURL, |
| 76 Ci.nsIStyleSheetService.USER_SHEET); | 79 Ci.nsIStyleSheetService.USER_SHEET); |
| 77 applied = true; | 80 applied = true; |
| 78 } | 81 } |
| 79 catch (e) | 82 catch (e) |
| 80 { | 83 { |
| 81 Cu.reportError(e); | 84 Cu.reportError(e); |
| 82 } | 85 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 95 { | 98 { |
| 96 Cu.reportError(e); | 99 Cu.reportError(e); |
| 97 } | 100 } |
| 98 applied = false; | 101 applied = false; |
| 99 } | 102 } |
| 100 } | 103 } |
| 101 | 104 |
| 102 // Send dummy message before initializing, this delay makes sure that the child | 105 // Send dummy message before initializing, this delay makes sure that the child |
| 103 // modules are loaded and our protocol handler registered. | 106 // modules are loaded and our protocol handler registered. |
| 104 port.emitWithResponse("ping").then(init); | 107 port.emitWithResponse("ping").then(init); |
| LEFT | RIGHT |