
View Image Context Menu Item — Anton G
Adds View Image to the image context menu.
Za uporabo te razširitve potrebujete Firefox
Metapodatki o razširitvi
Posnetki zaslona




O tej razširitvi
!! In an attempt to be compatible with image sites that block hot-linking, this add-on requires additional permissions to be able to intercept image requests and set the Referer header.
Description
Adds "View Image" context menu item for images, restoring old functionality replaced by the "Open Image in New Tab" official context menu item. Also adds "View Video" and "View Audio", functioning in a similar fashion.
Add-on contains an Options page allowing for configuration of what the various user actions can do. Default actions are:
- Left click opens selected image in the same tab.
- Shift left click opens selected image in a new window.
- Ctrl left click opens selected image in new foreground tab.
- Ctrl+shift left click opens selected image in new background tab.
- Middle click opens selected image in a new background tab.
userChrome.css
If you want to hide the default "Open Image in New Tab" context menu item and move this add-on's context menu items to the top, the following addition to userChrome.css should do the trick.
For a more detailed breakdown of how the userChrome works, as well as positioning the menu item in the expected place instead of at the very top of the context menu, please reference: https://github.com/agoupinets/view-image-context-menu-item/issues/14
Note: The new Proton UI and the old UI need slightly different CSS to hide the icon, so be sure to only use one of the related CSS lines.
Quick step-by-step explanation of how to apply userChrome.css here: https://imgur.com/a/eXnuFci
Description
Adds "View Image" context menu item for images, restoring old functionality replaced by the "Open Image in New Tab" official context menu item. Also adds "View Video" and "View Audio", functioning in a similar fashion.
Add-on contains an Options page allowing for configuration of what the various user actions can do. Default actions are:
- Left click opens selected image in the same tab.
- Shift left click opens selected image in a new window.
- Ctrl left click opens selected image in new foreground tab.
- Ctrl+shift left click opens selected image in new background tab.
- Middle click opens selected image in a new background tab.
userChrome.css
If you want to hide the default "Open Image in New Tab" context menu item and move this add-on's context menu items to the top, the following addition to userChrome.css should do the trick.
For a more detailed breakdown of how the userChrome works, as well as positioning the menu item in the expected place instead of at the very top of the context menu, please reference: https://github.com/agoupinets/view-image-context-menu-item/issues/14
Note: The new Proton UI and the old UI need slightly different CSS to hide the icon, so be sure to only use one of the related CSS lines.
/* Hides Open Image In New Tab */
#context-viewimage { display: none; }
/* Hides Open Video In New Tab */
#context-viewvideo { display: none; }
/* Moves View Image to the very top */
menuitem[id*="view-image-context-menu-item"] { -moz-box-ordinal-group: 0 !important; }
/* Moves View Video to the very top */
menuitem[id*="view-video-context-menu-item"] { -moz-box-ordinal-group: 0 !important; }
/* Moves View Audio to the very top */
menuitem[id*="view-audio-context-menu-item"] { -moz-box-ordinal-group: 0 !important; }
/* PROTON: Hides the View Image menu item icon */
menuitem[id*="view-image-context-menu-item"] > .menu-iconic-left { display: none !important; }
/* OLD UI: Hides the View Image menu item icon */
menuitem[id*="view-image-context-menu-item"] > .menu-iconic-left { visibility: hidden !important; }
/* Hides the View Video menu item icon */
menuitem[id*="view-video-context-menu-item"] > .menu-iconic-left { opacity: 0 !important; }
/* Hides the View Audio menu item icon */
menuitem[id*="view-audio-context-menu-item"] > .menu-iconic-left { opacity: 0 !important; }
Quick step-by-step explanation of how to apply userChrome.css here: https://imgur.com/a/eXnuFci
Komentarji razvijalca
Ocenite svojo izkušnjo
Prijavi ta dodatek kot zlorabo
Če sumite, da ta dodatek krši Mozilline pravilnike za dodatke ali da ima težave z zasebnostjo ali varnostjo, prijavite te težave Mozilli prek tega obrazca.
Ne uporabljajte tega obrazca za poročanje o napakah ali zahtevanje novih funkcij; poročilo bo poslano Mozilli in ne razvijalcu dodatka.
DovoljenjaVeč o tem
Ta dodatek lahko:
- dostopa do vaših podatkov za vse spletne strani
Več informacij
- Povezave dodatka
- Različica
- 3.2.1
- Velikost
- 73,6 KB
- Zadnja posodobitev
- pred 2 letoma (19. jun. 2021)
- Sorodne kategorije
- Licenca
- Licenca MIT
- Zgodovina različic
Dodaj v zbirko
Več razširitev razvijalca Anton G
- Še ni ocenjeno
- Še ni ocenjeno
- Še ni ocenjeno
- Še ni ocenjeno
- Še ni ocenjeno
- Še ni ocenjeno
Menu
The context menu items are bound to image and video contexts, and use the menus permission. The menu item implementation is mundane: a listener is bound to the click event handling the menu click and a listener is bound to the on-show event to show or hide the menu items based on options and if the image/video is already opened in the tab. Uses i18n message translation to get menu text. Hotkey is baked into the message text and changes based on browser language ('i' in English)
Normal Actions
For the actions of opening the image/video this extension relies on using:
- tabs.update() - open image/video in same tab
- tabs.create() - open image/video in new tab (background/foreground)
- windows.create() - open image/video in new window
None of those methods require special permission, but there is no way to set the Referer directly in those calls.
Referer
To support setting the Referer header, host access to all domains, along with blocking webrequest permissions is required. What the add-on does is before calling the aforementioned methods is bind a listener on web requests (blocking, request header, filtered to the destination URL) that alters the request header by adding a Referer entry based on the domain extracted from the context menu event page URL.
Note on loading
I'm not sure how Firefox chooses to use cached images vs fetching them, but I don't see a good way to force to use cached image when viewing the image, instead it always appears to refetch the image. After the initial load for an image by this add-on, Firefox does appear to start using the cached version - not sure why it can't do that right away.
Local images
Firefox has hefty restrictions on file:// URLs, including forbidding setting the current page or opening new pages with such URLs using the standard API. If this add-on detects that the image and the page are both local, it has a separate code path: it will create an anchor tag in the document and click it to navigate to the privileged URL. If it needs to create a new tab/window, it uses tabs.duplicate to create such a new tab/window that is still within the file:// scheme. Sadly that cause a brief reload of the parent page in the new tab/window.