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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 { | 627 { |
628 return new Window(win); | 628 return new Window(win); |
629 })); | 629 })); |
630 }, | 630 }, |
631 getLastFocused: function(callback) | 631 getLastFocused: function(callback) |
632 { | 632 { |
633 callback(new Window(safari.application.activeBrowserWindow)); | 633 callback(new Window(safari.application.activeBrowserWindow)); |
634 } | 634 } |
635 }; | 635 }; |
636 | 636 |
637 ext.backgroundPage = { | |
638 getWindow: function() | |
639 { | |
640 return safari.extension.globalPage.contentWindow; | |
641 } | |
642 }; | |
643 | |
644 ext.onMessage = new BackgroundMessageEventTarget(); | 637 ext.onMessage = new BackgroundMessageEventTarget(); |
645 | 638 |
646 var contextMenuItems = []; | 639 var contextMenuItems = []; |
647 var isContextMenuHidden = true; | 640 var isContextMenuHidden = true; |
648 ext.contextMenus = { | 641 ext.contextMenus = { |
649 addMenuItem: function(title, contexts, onclick) | 642 addMenuItem: function(title, contexts, onclick) |
650 { | 643 { |
651 contextMenuItems.push({ | 644 contextMenuItems.push({ |
652 id: String(contextMenuItems.length), | 645 id: String(contextMenuItems.length), |
653 title: title, | 646 title: title, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 for (var i = 0; i < contextMenuItems.length; i++) | 694 for (var i = 0; i < contextMenuItems.length; i++) |
702 { | 695 { |
703 if (contextMenuItems[i].id == event.command) | 696 if (contextMenuItems[i].id == event.command) |
704 { | 697 { |
705 contextMenuItems[i].onclick(event.userInfo.srcUrl, new Tab(safari.applic
ation.activeBrowserWindow.activeTab)); | 698 contextMenuItems[i].onclick(event.userInfo.srcUrl, new Tab(safari.applic
ation.activeBrowserWindow.activeTab)); |
706 break; | 699 break; |
707 } | 700 } |
708 } | 701 } |
709 }, false); | 702 }, false); |
710 })(); | 703 })(); |
OLD | NEW |