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-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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 524 } |
525 | 525 |
526 return frames[0]; | 526 return frames[0]; |
527 } | 527 } |
528 }; | 528 }; |
529 } | 529 } |
530 | 530 |
531 return ext.onMessage._dispatch(message, sender, sendResponse).indexOf(true)
!= -1; | 531 return ext.onMessage._dispatch(message, sender, sendResponse).indexOf(true)
!= -1; |
532 }); | 532 }); |
533 | 533 |
534 // We have to ensure there is at least one listener for the onConnect event. | |
535 // Otherwise we can't connect a port later, which we need to do in order to | |
536 // detect when the extension is reloaded, disabled or uninstalled. | |
537 chrome.runtime.onConnect.addListener(function() {}); | |
538 | |
539 | 534 |
540 /* Storage */ | 535 /* Storage */ |
541 | 536 |
542 ext.storage = { | 537 ext.storage = { |
543 get: function(keys, callback) | 538 get: function(keys, callback) |
544 { | 539 { |
545 chrome.storage.local.get(keys, callback); | 540 chrome.storage.local.get(keys, callback); |
546 }, | 541 }, |
547 set: function(key, value, callback) | 542 set: function(key, value, callback) |
548 { | 543 { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 callback(new Page(tab)); | 580 callback(new Page(tab)); |
586 } | 581 } |
587 else | 582 else |
588 { | 583 { |
589 ext.pages.open(optionsUrl, callback); | 584 ext.pages.open(optionsUrl, callback); |
590 } | 585 } |
591 }); | 586 }); |
592 }); | 587 }); |
593 }; | 588 }; |
594 })(); | 589 })(); |
OLD | NEW |