Closed Bug 497170 Opened 16 years ago Closed 15 years ago

Context menu request - save images

Categories

(Mozilla Labs :: Prism, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: techie.brandon, Assigned: matthew.gertner)

Details

Attachments

(3 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 (CK-IBM) Firefox/3.0.10 Build Identifier: 1.0b1 I am using Prism with IBM's Rational Jazz Team Concert (http://jazz.net/), it would be nice to be able to save images or files via the right-click context menu. From my experience it looks as though there is no possible way to save image or files when using Prism. Some webapp expect this to be avaliable from whatever browser is being used. Reproducible: Always Steps to Reproduce: 1.Visit website with images and links 2.Right-click on image 3.Notice lack of context menu's 'Save Link As..' & 'Save Image As..' options Actual Results: Only Copy/Paste context menu options Expected Results: Would expect to have 'Save Link As..' when right-clicking on link; Would expect 'Save Image As..' when right-clicking on image.
I had the same problem and i resolve by modify 3 file If there's better solution than mine plese post!! P.S. Excuse for my poor english level :) 1)------------------------------------ prism\chrome\en-US\webrunner.dtd -------------------------------------- <!ENTITY saveLink.label "Save Link As.."> 2)------------------------------------ prism\chrome\webrunner\content\webrunner.xul -------------------------------------- //near row 50 //the code wich implement internalSave() function is present in toolkit.jar file <script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/> //near row 53 <command id="cmd_saveLink" label="&saveLink.label;" oncommand="WebRunner.doCommand(this.id);"/> //near row 107 <menuitem id="menuitem_saveLink" command="cmd_saveLink"/> <menuseparator id="menusep_saveLink"/> 3)------------------------------------ prism\chrome\webrunner\content\webrunner.js -------------------------------------- //near row 299 var savelink = document.getElementById("menuitem_saveLink"); var savelinkSep = document.getElementById("menusep_copyLink"); //near row 313 //this active button only when ther's link savelink.hidden = !foundLink; savelinkSep.hidden = !foundLink; //near row 831 //in document.popupNode.href i find the url of file case "cmd_saveLink": internalSave(document.popupNode.href, null); break;
If you post your changes as a patch and flag me for review, I'll take a look and try to get the changes into Prism.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Excuse me but when you say "flag me for review", the meaning was you're in cc list? I don't want post my changes as a patch, but only to share a solution that work for me... I don't know if this is the final solution for everybody!!
I also add "Save image as..." function!! In this two file ther's all, for "Save image as..." you must add a row in webrunner.dtd <!ENTITY saveImage.label "Save image as..."> Now test this!! Bye Bye
"Flag for review" means click on the Details link next to the attachment, set the dropdown next to Review to "?" and put my email in the requestee box. Thanks.
Attachment #445116 - Flags: review?(mark.finkle)
Comment on attachment 445116 [details] [diff] [review] Add Save Image As to context menu using contentAreaUtils.js implementation >+ var saveImage = document.getElementById("menuitem_saveImage"); >+ var foundImage = false; >+ if (target instanceof Ci.nsIImageLoadingContent && new XPCNativeWrapper(target.QueryInterface(Ci.nsIImageLoadingContent)).currentURI) { >+ foundImage = true; You might want to make sure the image was completely loaded. Fennec does that here: http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser-ui.js#2241
Attachment #445116 - Flags: review?(mark.finkle) → review+
(In reply to comment #9) > You might want to make sure the image was completely loaded. Why?
(In reply to comment #10) > (In reply to comment #9) > > You might want to make sure the image was completely loaded. > > Why? If the URL is not to a valid image, the save process will fail.
Assignee: nobody → matthew.gertner
Attachment #445116 - Attachment is obsolete: true
Make suggested change and committed: Sending chrome/content/webrunner.js Sending chrome/content/webrunner.xul Transmitting file data .. Committed revision 67389.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: