LEFT | RIGHT |
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 29 matching lines...) Expand all Loading... |
40 }; | 40 }; |
41 | 41 |
42 this.browserAction = new BrowserAction(this); | 42 this.browserAction = new BrowserAction(this); |
43 this.contextMenus = new ContextMenus(this); | 43 this.contextMenus = new ContextMenus(this); |
44 }; | 44 }; |
45 Page.prototype = { | 45 Page.prototype = { |
46 get url() | 46 get url() |
47 { | 47 { |
48 return this._frames[0].url; | 48 return this._frames[0].url; |
49 }, | 49 }, |
50 equals: function(page) | |
51 { | |
52 return this._id == page._id; | |
53 }, | |
54 activate: function() | 50 activate: function() |
55 { | 51 { |
56 this._tab.activate(); | 52 this._tab.activate(); |
57 }, | 53 }, |
58 sendMessage: function(message, responseCallback) | 54 sendMessage: function(message, responseCallback) |
59 { | 55 { |
60 this._messageProxy.sendMessage(message, responseCallback, {pageId: this._i
d}); | 56 this._messageProxy.sendMessage(message, responseCallback, {pageId: this._i
d}); |
61 } | 57 } |
| 58 }; |
| 59 |
| 60 ext._getPage = function(id) |
| 61 { |
| 62 return pages[id]; |
62 }; | 63 }; |
63 | 64 |
64 var isPageActive = function(page) | 65 var isPageActive = function(page) |
65 { | 66 { |
66 var tab = page._tab; | 67 var tab = page._tab; |
67 var win = tab.browserWindow; | 68 var win = tab.browserWindow; |
68 return win && tab == win.activeTab && page == tab._visiblePage; | 69 return win && tab == win.activeTab && page == tab._visiblePage; |
69 }; | 70 }; |
70 | 71 |
71 var forgetPage = function(id) | 72 var forgetPage = function(id) |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 page.activate(); | 676 page.activate(); |
676 if (callback) | 677 if (callback) |
677 callback(page); | 678 callback(page); |
678 return; | 679 return; |
679 } | 680 } |
680 } | 681 } |
681 | 682 |
682 ext.pages.open(optionsUrl, callback); | 683 ext.pages.open(optionsUrl, callback); |
683 }; | 684 }; |
684 })(); | 685 })(); |
LEFT | RIGHT |