From 4f89a6f89db920e10c7dbb775010760d5e79edfd Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 20 Sep 2019 07:51:47 -0400 Subject: [PATCH] Fix missing "Block element" in Firefox's menu Regression from: - https://github.com/gorhill/uBlock/commit/58620fb05150cd8cc06a2cfad64011ca34f93468 --- platform/firefox/manifest.json | 2 +- src/js/start.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/firefox/manifest.json b/platform/firefox/manifest.json index d13a0e3cf..ccdc3e6fe 100644 --- a/platform/firefox/manifest.json +++ b/platform/firefox/manifest.json @@ -73,7 +73,7 @@ "open_in_tab": true }, "permissions": [ - "contextMenus", + "menus", "privacy", "storage", "tabs", diff --git a/src/js/start.js b/src/js/start.js index 4018c5187..a52e9c78b 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -297,6 +297,7 @@ try { // Final initialization steps after all needed assets are in memory. +// Start network observers. µb.webRequest.start(); // Ensure that the resources allocated for decompression purpose (likely @@ -318,10 +319,12 @@ initializeTabs(); : 0 ); -µb.contextMenu.update(null); +// Force an update of the context menu according to the currently +// active tab. +µb.contextMenu.update(); // https://github.com/uBlockOrigin/uBlock-issues/issues/717 -// Prevent the extensions from being restarted mid-session. +// Prevent the extension from being restarted mid-session. browser.runtime.onUpdateAvailable.addListener(details => { const toInt = vAPI.app.intFromVersion; if (