Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Page context menu] CSS for removing items (share code here) #76

Closed
qusielle opened this issue Nov 29, 2017 · 11 comments
Closed

[Page context menu] CSS for removing items (share code here) #76

qusielle opened this issue Nov 29, 2017 · 11 comments

Comments

@qusielle
Copy link

There is a cool manual to remove waste items from context menus: https://www.reddit.com/r/firefox/comments/7dvtw0/guide_how_to_edit_your_context_menu/
Could you include this to your project?
And thank you so much for your custom css! This is why i returned to FF.

@Aris-t2
Copy link
Owner

Aris-t2 commented Nov 30, 2017

There are about 94 items inside that context menu, if you count menuitems, menus and separators (excluding installed add-ons).

The mentioned list only covers the parts for "page context" and "link context" and misses the rest: media/video, images, marked text etc.
I'm not going to include the full list, but also not only some part of it, sorry.

@stonecrusher
Copy link
Contributor

stonecrusher commented Nov 30, 2017

Aris is right, it covers just roughly 1/3 of the menu items available.
But it covers the most common / annoying items and would have been helpful to me, too, as I had to inspect everything by myself to find the right selectors.

Maybe we could provide the link to the tutorial on "Other projects"? If the reddit post is not updated, I'm seriously thinking about opening that as GitHub project, providing a rudimental substitute for MenuWizard addon.

edit

On the other hand, we already have

/* edit target file to select which items to hide ***********************************************/
@import url(./css/tabs/tab_context_menuitems_visibility.css); /**/

and

@import url(./css/generalui/send_to_device_menuitems_hidden.css); /**/

and

@import url(./css/toolbars/toolbar_context_menuitems_visibility.css); /**/

in this project.

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 2, 2017

The first and third are basically ports of CTR options.

The second one is there, because its a stupid Firefox issue to show this item when sync is not used.

A file to manage all 94 entries of page context menu would be 580 lines long. I doubt anybody would like to go through that amount of code to just find a specific item.

@stonecrusher
Copy link
Contributor

I doubt anybody would like to go through that amount of code

Of course it will be divided in blank context menu, link context menu, image context menu, video context menu and so on.

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 2, 2017

Feel free to create those files.

@stonecrusher
Copy link
Contributor

For sure it's not complete (e.g. I couldn't reach any dictionary and spellchecking related context menus) but should be enough for the moment to cover most of the possible items.

Feel free to copy and adapt.

https://github.com/stonecrusher/simpleMenuWizard

@Aris-t2 Aris-t2 changed the title Add css for removing items from context menu, please [Page context menu] CSS for removing items (share code here) Dec 3, 2017
@ghost
Copy link

ghost commented Dec 3, 2017

@stonecrusher Possible hide disactive options (gray "#B0B0AF")?

obraz

@stonecrusher
Copy link
Contributor

@userOperaFF Yes, I've made an update to simpleMenuWizard.

But in this case, it's actually just one line in userChrome.css to hide all disabled items:

#mainPopupSet menuitem[disabled="true"] { display: none !important; }

@ghost
Copy link

ghost commented Dec 5, 2017

Possible hide double lines in link right click menu, textarea/input right click menu, selected text right click menu? Maybe hide some menuitem (this is leftover from send element to > firefox sync; hide default).

link right click menu textarea/input right click menu selected text right click menu
link right click menu textarea/input right click menu selected text right click menu

Find parent / children css family is not my forte

@stonecrusher
Copy link
Contributor

I don't know where you have those separators from. Between Inspect Element and Block element is just one separator for me and no further item.

From the sourcecode the only things that might be in between are

#context-media-eme-separator,
#context-media-eme-learnmore  /* Learn more about DRM... */
   { display:none !important; }

You can try that code, see if it helps.
Otherwise it's something you changed or from addons. Try to disable each respectively and see what happens.

I guess both uBlock and bitwarden add a separator.

@ghost
Copy link

ghost commented Dec 6, 2017

</menupopup>
<!--        (...)       -->
   <menuitem id="context-inspect" label="Inspect element" accesskey="t" oncommand="gContextMenu.inspectNode();"/>
   <menuseparator id="context-media-eme-separator" hidden="true"/>
   <menuitem id="context-media-eme-learnmore" class="menuitem-iconic" hidden="true" label="Learn more about DRM…" accesskey="D" oncommand="gContextMenu.drmLearnMore(event);" onclick="checkForMiddleClick(this, event);"/><menuseparator/>
<!--        (GUILTY!)       -->
   <menuseparator id="_479f0278-2c34-4365-b9f0-1d328d0f0a40__separator" image="moz-extension://702e6c72-3483-4e50-b172-ffa1856450e9/data/icons/48.png"/>
<!--        (GUILTY!)       -->
   <menuitem label="Take Screenshot" id="screenshots_mozilla_org_create-screenshot"/>
   <menuitem label="Block element" id="ublock0_raymondhill_net_uBlock0-blockElement" class="menuitem-iconic" image="moz-extension://a826dd0a-4b47-4a4c-8719-9e5a6c5e5378/img/ublock.svg"/>
</menupopup>

Bug with https://addons.mozilla.org/en-US/firefox/addon/javascript-toggler/
moz-extension://702e6c72-3483-4e50-b172-ffa1856450e9/data/icons/48.png

individual CSS for sesion installed addon:

#_479f0278-2c34-4365-b9f0-1d328d0f0a40__separator   { display:none !important; }

...and gone. This is easier than to spend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants