Index: ext/background.js |
=================================================================== |
--- a/ext/background.js |
+++ b/ext/background.js |
@@ -70,17 +70,21 @@ |
/* Pages */ |
let Page = ext.Page = function(tab) |
{ |
this.id = tab.id; |
this._url = tab.url && new URL(tab.url); |
this.browserAction = new BrowserAction(tab.id); |
- this.contextMenus = new ContextMenus(this); |
+ |
+ // Firefox for Android does not support context menus. |
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1269062 |
+ 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.
|
+ this.contextMenus = new ContextMenus(this); |
}; |
Page.prototype = { |
get url() |
{ |
// usually our Page objects are created from Chrome's Tab objects, which |
// provide the url. So we can return the url given in the constructor. |
if (this._url) |
return this._url; |
@@ -418,17 +422,19 @@ |
/* Context menus */ |
let contextMenuItems = new ext.PageMap(); |
let contextMenuUpdating = false; |
let updateContextMenu = () => |
{ |
- if (contextMenuUpdating) |
+ // Firefox for Android does not support context menus. |
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1269062 |
+ if (!("contextMenus" in chrome) || contextMenuUpdating) |
return; |
contextMenuUpdating = true; |
chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => |
{ |
chrome.contextMenus.removeAll(() => |
{ |