OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 }, | 53 }, |
54 sendMessage: function(message, responseCallback) | 54 sendMessage: function(message, responseCallback) |
55 { | 55 { |
56 this._messageProxy.sendMessage(message, responseCallback, {pageId: this._i
d}); | 56 this._messageProxy.sendMessage(message, responseCallback, {pageId: this._i
d}); |
57 } | 57 } |
58 }; | 58 }; |
59 | 59 |
60 var isPageActive = function(page) | 60 var isPageActive = function(page) |
61 { | 61 { |
62 var tab = page._tab; | 62 var tab = page._tab; |
63 return tab == tab.browserWindow.activeTab && page == tab._visiblePage; | 63 var win = tab.browserWindow; |
| 64 return win && tab == win.activeTab && page == tab._visiblePage; |
64 }; | 65 }; |
65 | 66 |
66 var forgetPage = function(id) | 67 var forgetPage = function(id) |
67 { | 68 { |
68 ext._removeFromAllPageMaps(id); | 69 ext._removeFromAllPageMaps(id); |
69 | 70 |
70 delete pages[id]._tab._pages[id]; | 71 delete pages[id]._tab._pages[id]; |
71 delete pages[id]; | 72 delete pages[id]; |
72 }; | 73 }; |
73 | 74 |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 page.activate(); | 671 page.activate(); |
671 if (callback) | 672 if (callback) |
672 callback(page); | 673 callback(page); |
673 return; | 674 return; |
674 } | 675 } |
675 } | 676 } |
676 | 677 |
677 ext.pages.open(optionsUrl, callback); | 678 ext.pages.open(optionsUrl, callback); |
678 }; | 679 }; |
679 })(); | 680 })(); |
OLD | NEW |