Closed thunderstone135 closed 9 months ago
Yeah, it's actually impossible only CSS.
However, you can use pointer-events: none
for userContent
's image elements to make them unrecognized.
I tried pointer-event, but it didn't work. It is still showing Open Image in New Tab and Copy Image Link.
I don't know what you did, but you have to apply it to the image
.
For example, to prevent the context menu button from running on the logo on a new tab.
.logo {
pointer-events: none;
}
I was actually talking about the background-image associated with this π
https://github.com/black7375/Firefox-UI-Fix/blob/6d2cfe210ef3208c56aaf94aeffa569fdb0c1701/css/leptonContent.css#L493-L509
I can't seem to remove the context menu items that appeared after I enabled userContent.newTab.background_image
.
I probably should have added a screenshot in the first post π
I got it. It's an unintended change of behavior, so I want to solve it, but CSS alone is quite tricky.
I know, right? I'm still researching if there's a way to hide those context menu items without resorting to JavaScript.
The only success I had so far is adding this on userChrome.css π
#context-copyimage, #context-viewimage {
display: none !important;
}
The only caveat is it disables Open Image in New Tab and Copy Image Link everywhere.
I'm sure @2641a40fd44383320adde4b027a1d0b03bd550 's amazing work has solved this bug. Thanks!!
Nicely doneπ
Is your feature request related to a problem?
Hi, I just want to ask if it is possible to remove the context menu items below π
When browsing the following pages π
The solution I'd like
I was actually able to remove Open Image in New Tab and Copy Image Link with this π
However, I didn't want these context menu items removed on all websites. Just on about:blank, about:home, about:newtab, and about:privatebrowsing. So, I tried it with this π
I tried it on userChrome and userContent. It doesn't work. I researched the issue and found that it can be done through JavaScript. I checked if it was possible with userscript. It wasn't. The only URL Patterns supported are http, https, file, ftp, ws, wss, data, and (chrome-) extension. Another method came to mind, but it was too complicated so I'm not going to mention it here.
Putting that aside, some might wonder why I wanted those two context menu items removed. You see, before I enabled
userContent.newTab.background_image
, those items were not present. Those items would probably not bother some people, but it does bother me. I'm probably just OCD.With that said, I posted here just in case I missed something that can be done in CSS.
Screenshots or video
N/A
Alternatives I've considered
N/A
Additional context
N/A