Bug: Menu disappearing
I lost my menu and tried multiple attempts without success.
The expert file loads but then it doesn't show in the contextual menu.
The name of my root had been changed and when I import menu it renames it to Custom Menu.
I noticed this myself too... The code hasn't changed in years so I'm fairly certain this has to do with google ditching manifest v2 in favor of manifest v3. Chances are they're just deleting the settings in the process of disabling the extensions for some reason... Can't really do much about this unfortunately :( And soon the extension will be disabled altogether due to manifest v3 not being supported anymore. I hate it as well but can't do much against the powers of google here.
Either way thanks for the bug report, good to see that I wasn't alone and I'm sure anybody who sees this issue will also be glad to know.
https://chatgpt.com/c/677c67dc-f9b8-8009-8258-63a1a000c27b
for people interested, I asked chatGPT to explain...
The link isn't working for me (not sure if you can share those URLs, maybe you need to make something public?)
Ok. yes this is the share link.
https://chatgpt.com/share/677d0439-1bd8-8009-969f-5bb5ec2ed553
Q.crm no longer working?
Custom right click menu.
something having to do with google manifest 3; ditching v2
Yes, your custom right-click menu (CRM) may stop working due to the transition from Google Chrome's Manifest V2 to Manifest V3. This update changes how extensions handle permissions, background scripts, and content scripts, affecting custom right-click menu functionality.
Key Changes in Manifest V3: Service Workers:
Manifest V3 replaces persistent background pages with service workers. Unlike background pages, service workers are event-driven and do not run persistently, which may impact how menus are created or dynamically updated. Permissions:
Extensions using Manifest V3 must explicitly declare all permissions at the time of installation. Modifying context menus dynamically based on actions could require a different approach to permission handling. Synchronous APIs:
Some APIs available in Manifest V2, such as synchronous messaging, have been removed or replaced in Manifest V3, affecting extensions that rely on instant updates to menus. Deprecation of V2:
Google has deprecated Manifest V2, and browsers like Chrome no longer support it as of 2024, rendering V2-based extensions nonfunctional. Fixing or Migrating to Manifest V3: To fix your custom right-click menu, you'll need to update your extension to conform to Manifest V3 standards. Here's a guide:
- Update manifest.json: Change the manifest_version to 3. Use the background key with a service_worker instead of background scripts. Declare contextMenus permission explicitly.
{ "manifest_version": 3, "name": "Custom Right Click Menu", "version": "1.0", "permissions": ["contextMenus"], "background": { "service_worker": "background.js" } }
- Refactor Background Scripts: Use service workers to handle context menu creation.
// background.js chrome.runtime.onInstalled.addListener(() => { chrome.contextMenus.create({ id: "customMenu", title: "Custom Menu Item", contexts: ["all"] }); });
chrome.contextMenus.onClicked.addListener((info, tab) => { if (info.menuItemId === "customMenu") { console.log("Custom menu clicked!"); // Perform your action here } });
- Debug and Test: Install the updated extension in Chrome and ensure the menu functions as expected. Test across various contexts (e.g., page, link, image) to verify proper behavior.
- Consider Alternatives: If your CRM relies on dynamic features unsupported by service workers, explore using a popup or injecting content scripts for user interaction. Notes: Transition Deadline: Check the browser’s Manifest V2 deprecation schedule if you’re using a Chromium-based browser other than Chrome, like Edge or Brave, as timelines may differ. Firefox Support: Firefox has its own implementation of Manifest V3 but still supports some Manifest V2 features. Would you like help troubleshooting or updating specific CRM functionality?
Ah yeah that's indeed why it's no longer working, but it's not that trivial to make those changes. More about that here: https://github.com/SanderRonde/CustomRightClickMenu/issues/84#issuecomment-2453092928