diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index a7361b27a..c3c618dae 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.3.5", + "version": "1.3.6", "default_locale": "en", "description": "__MSG_extShortDesc__", diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index c9f970dfa..81d0d57c4 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -2384,15 +2384,34 @@ vAPI.toolbarButton = { }); }; + // https://github.com/gorhill/uBlock/issues/955 + // Defer until `NativeWindow` is available. + tbb.initOne = function(win, tryCount) { + if ( !win.NativeWindow ) { + if ( typeof tryCount !== 'number' ) { + tryCount = 0; + } + tryCount += 1; + if ( tryCount < 10 ) { + vAPI.setTimeout( + this.initOne.bind(this, win, tryCount), + 200 + ); + } + return; + } + var label = this.getMenuItemLabel(); + var id = win.NativeWindow.menu.add({ + name: label, + callback: this.onClick + }); + menuItemIds.set(win, id); + }; + tbb.init = function() { // Only actually expecting one window under Fennec (note, not tabs, windows) for ( var win of winWatcher.getWindows() ) { - var label = this.getMenuItemLabel(); - var id = win.NativeWindow.menu.add({ - name: label, - callback: this.onClick - }); - menuItemIds.set(win, id); + this.initOne(win); } cleanupTasks.push(shutdown); diff --git a/platform/opera/manifest.json b/platform/opera/manifest.json index 0ce690e8a..53cabebd2 100644 --- a/platform/opera/manifest.json +++ b/platform/opera/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.3.5", + "version": "1.3.6", "default_locale": "en", "description": "__MSG_extShortDesc__",