File tree Expand file tree Collapse file tree 3 files changed +42
-6
lines changed Expand file tree Collapse file tree 3 files changed +42
-6
lines changed Original file line number Diff line number Diff line change 288
288
hidden ="true"
289
289
oncommand ="gContextMenu.openPasswordManager();" />
290
290
<menuseparator id ="passwordmgr-items-separator" />
291
+ <menuseparator id ="context-sep-viewbgimage" />
292
+ <menuitem id ="context-viewbgimage"
293
+ data -l10n -id ="main-context-menu-image-view-background"
294
+ oncommand ="gContextMenu.viewMedia(event);" />
291
295
<menuitem id ="context-undo"
292
296
data -l10n -id ="text-action-undo"
293
297
command ="cmd_undo" />
Original file line number Diff line number Diff line change @@ -677,7 +677,35 @@ class nsContextMenu {
677
677
! this . onAudio &&
678
678
! this . onLink &&
679
679
! this . onTextInput ;
680
- this . showItem ( "context-viewimage" , showViewImage || showBGImage ) ;
680
+ this . showItem ( "context-viewimage" , showViewImage ) ;
681
+
682
+ var shouldShow = ! (
683
+ this . isContentSelected ||
684
+ this . onImage ||
685
+ this . onCanvas ||
686
+ this . onVideo ||
687
+ this . onAudio ||
688
+ this . onLink ||
689
+ this . onTextInput
690
+ ) ;
691
+
692
+ this . showItem (
693
+ "context-viewbgimage" ,
694
+ shouldShow &&
695
+ ! this . hasMultipleBGImages &&
696
+ ! this . inSyntheticDoc &&
697
+ ! this . inPDFViewer
698
+ ) ;
699
+
700
+ this . showItem (
701
+ "context-sep-viewbgimage" ,
702
+ shouldShow &&
703
+ ! this . hasMultipleBGImages &&
704
+ ! this . inSyntheticDoc &&
705
+ ! this . inPDFViewer
706
+ ) ;
707
+
708
+ this . document . getElementById ( "context-viewbgimage" ) . disabled = ! this . hasBGImage ;
681
709
682
710
// Save image depends on having loaded its content.
683
711
this . showItem (
@@ -1688,9 +1716,9 @@ class nsContextMenu {
1688
1716
// Change current window to the URL of the image, video, or audio.
1689
1717
viewMedia ( e ) {
1690
1718
let where = BrowserUtils . whereToOpenLink ( e , false , false ) ;
1691
- if ( where == "current" ) {
1692
- where = "tab" ;
1693
- }
1719
+ // if (where == "current") {
1720
+ // where = "tab";
1721
+ // }
1694
1722
let referrerInfo = this . contentData . referrerInfo ;
1695
1723
let systemPrincipal = Services . scriptSecurityManager . getSystemPrincipal ( ) ;
1696
1724
if ( this . onCanvas ) {
Original file line number Diff line number Diff line change @@ -266,11 +266,15 @@ main-context-menu-image-reload =
266
266
.accesskey = R
267
267
268
268
main-context-menu-image-view-new-tab =
269
- .label = Open Image in New Tab
269
+ .label = View Image
270
270
.accesskey = I
271
271
272
+ main-context-menu-image-view-background =
273
+ .label = View Background Image
274
+ .accesskey = w
275
+
272
276
main-context-menu-video-view-new-tab =
273
- .label = Open Video in New Tab
277
+ .label = View Video
274
278
.accesskey = i
275
279
276
280
main-context-menu-image-copy =
You can’t perform that action at this time.
0 commit comments