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 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 activate: function() | |
51 { | |
52 this._tab.activate(); | |
53 }, | |
54 sendMessage: function(message, responseCallback) | 50 sendMessage: function(message, responseCallback) |
55 { | 51 { |
56 this._messageProxy.sendMessage(message, responseCallback, {pageId: this._i
d}); | 52 this._messageProxy.sendMessage(message, responseCallback, {pageId: this._i
d}); |
57 } | 53 } |
58 }; | 54 }; |
59 | 55 |
60 ext._getPage = function(id) | 56 ext._getPage = function(id) |
61 { | 57 { |
62 return pages[id]; | 58 return pages[id]; |
63 }; | 59 }; |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 660 |
665 /* Options */ | 661 /* Options */ |
666 | 662 |
667 ext.showOptions = function(callback) | 663 ext.showOptions = function(callback) |
668 { | 664 { |
669 var optionsUrl = safari.extension.baseURI + "options.html"; | 665 var optionsUrl = safari.extension.baseURI + "options.html"; |
670 | 666 |
671 for (var id in pages) | 667 for (var id in pages) |
672 { | 668 { |
673 var page = pages[id]; | 669 var page = pages[id]; |
| 670 var tab = page._tab; |
674 | 671 |
675 if (page.url == optionsUrl && page._tab.browserWindow == safari.applicatio
n.activeBrowserWindow) | 672 if (page.url == optionsUrl && tab.browserWindow == safari.application.acti
veBrowserWindow) |
676 { | 673 { |
677 page.activate(); | 674 tab.activate(); |
678 if (callback) | 675 if (callback) |
679 callback(page); | 676 callback(page); |
680 return; | 677 return; |
681 } | 678 } |
682 } | 679 } |
683 | 680 |
684 ext.pages.open(optionsUrl, callback); | 681 ext.pages.open(optionsUrl, callback); |
685 }; | 682 }; |
686 })(); | 683 })(); |
OLD | NEW |