OLD | NEW |
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 384 } |
385 | 385 |
386 return frames[0]; | 386 return frames[0]; |
387 } | 387 } |
388 } | 388 } |
389 }; | 389 }; |
390 | 390 |
391 return ext.onMessage._dispatch(message, sender, sendResponse).indexOf(true)
!= -1; | 391 return ext.onMessage._dispatch(message, sender, sendResponse).indexOf(true)
!= -1; |
392 }); | 392 }); |
393 | 393 |
| 394 // We have to ensure there is at least one listener for the onConnect event. |
| 395 // Otherwise we can't connect a port later, which we need to do in order to |
| 396 // detect when the extension is reloaded, disabled or uninstalled. |
| 397 chrome.runtime.onConnect.addListener(function() {}); |
| 398 |
394 | 399 |
395 /* Storage */ | 400 /* Storage */ |
396 | 401 |
397 ext.storage = localStorage; | 402 ext.storage = localStorage; |
398 | 403 |
399 | 404 |
400 /* Options */ | 405 /* Options */ |
401 | 406 |
402 ext.showOptions = function(callback) | 407 ext.showOptions = function(callback) |
403 { | 408 { |
(...skipping 27 matching lines...) Expand all Loading... |
431 callback(new Page(tab)); | 436 callback(new Page(tab)); |
432 } | 437 } |
433 else | 438 else |
434 { | 439 { |
435 ext.pages.open(optionsUrl, callback); | 440 ext.pages.open(optionsUrl, callback); |
436 } | 441 } |
437 }); | 442 }); |
438 }); | 443 }); |
439 }; | 444 }; |
440 })(); | 445 })(); |
OLD | NEW |