| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 /* Pages */ | 70 /* Pages */ |
| 71 | 71 |
| 72 let Page = ext.Page = function(tab) | 72 let Page = ext.Page = function(tab) |
| 73 { | 73 { |
| 74 this.id = tab.id; | 74 this.id = tab.id; |
| 75 this._url = tab.url && new URL(tab.url); | 75 this._url = tab.url && new URL(tab.url); |
| 76 | 76 |
| 77 this.browserAction = new BrowserAction(tab.id); | 77 this.browserAction = new BrowserAction(tab.id); |
| 78 | 78 this.contextMenus = new ContextMenus(this); |
| 79 // Firefox for Android does not support context menus. | |
| 80 // https://bugzilla.mozilla.org/show_bug.cgi?id=1269062 | |
| 81 if ("contextMenus" in chrome) | |
|
Wladimir Palant
2017/08/16 13:21:56
I don't think that this change is necessary. It sh
Manish Jethani
2017/08/16 19:39:09
Done.
| |
| 82 this.contextMenus = new ContextMenus(this); | |
| 83 }; | 79 }; |
| 84 Page.prototype = { | 80 Page.prototype = { |
| 85 get url() | 81 get url() |
| 86 { | 82 { |
| 87 // usually our Page objects are created from Chrome's Tab objects, which | 83 // usually our Page objects are created from Chrome's Tab objects, which |
| 88 // provide the url. So we can return the url given in the constructor. | 84 // provide the url. So we can return the url given in the constructor. |
| 89 if (this._url) | 85 if (this._url) |
| 90 return this._url; | 86 return this._url; |
| 91 | 87 |
| 92 // but sometimes we only have the tab id when we create a Page object. | 88 // but sometimes we only have the tab id when we create a Page object. |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 ext.windows = { | 741 ext.windows = { |
| 746 create(createData, callback) | 742 create(createData, callback) |
| 747 { | 743 { |
| 748 chrome.windows.create(createData, createdWindow => | 744 chrome.windows.create(createData, createdWindow => |
| 749 { | 745 { |
| 750 afterTabLoaded(callback)(createdWindow.tabs[0]); | 746 afterTabLoaded(callback)(createdWindow.tabs[0]); |
| 751 }); | 747 }); |
| 752 } | 748 } |
| 753 }; | 749 }; |
| 754 }()); | 750 }()); |
| LEFT | RIGHT |