stonecrusher/simpleMenuWizard

How does one go about finding out the ID for addons?

Closed this issue · 5 comments

Firstly, thanks for sharing your work.

I'm trying to workout how to hide the context menu items for 1Password, Cookie AutoDelete and Zotero.

How does one go about finding this information out? Is it easy to explain? If it is maybe a description could be included in the Readme?

Best,

Hey,

You need to

  1. Open the browser tools (ctrl + shift + alt + i).
  2. Accept connection.
  3. In the three dots menu, choose to not auto-close popups (needs a checkmark).
  4. Go to the browser and open the context menu you want.
  5. Arrange the windows so you can see the context menu and the browser tools window at the same time.
  6. In browser tools window, go to the inspector tab and on top left there is an icon showing a window with a cursor ("choose element from site"). click that.
  7. Now hover or click the contextmenu item you want to inspect.
  8. The html node will be highlighted in the browser tools window. You just need to read / copy it's id attribute.

Be aware that some extensions have their UUID in that id. That means it's different for every profile. So something like copying to another PC might not work. But don't worry, you'll see immediately if it is a wild id with gibberish or just something like zotero-search-doi

I don't know of any instructions out there for doing that. It's "just using the devtools / browsertools". So it's a mixture of web developer basics, trial and error and mozilla's docs.

Hope I could help

Thank you very much for the detailed breakdown.

I managed very briefly to hide the items I wanted to. Then some of them came back. Checking again the IDs had changed. For example, the last number of zotero's ID, "zotero_chnm_gmu_edu-menuitem-69", changed. Then it changed again after I adjusted my CSS.

Is their something obviously wrong here? Or, is there an alternative approach to using the ID?

Thanks again for your help so far. I'm not very good at this.

Nope, that is because extension devs do what they want :)
Apparently zotero changes id every time you restart the browser.

If only the end changes, try using a different selector like menuitem[id^="zotero_chnm_gmu_edu-menuitem-"] instead of #zotero_chnm_gmu_edu-menuitem-69. So you will target only the beginning of the id.

I hope I'm not speaking too soon, but after some detective work I think have it.

menu[label="Zotero Connector"] {
display: none !important;
}

Look at the inspector, I eventually realised that what I am hiding is not a menu item itself, but leads to a sub-menu of menu items.

It similarly worked for the other addons I was trying to block.

Thank you for pointing me in the right direction!

Ah yes, I forgot you can just target the label. This is usually not possible for me as the labels change with the language chosen, thus wouldn't work for everybody.

Glad that it works for you now!