Closed Bug 1091622 Opened 10 years ago Closed 7 years ago

"Save image" action from browser saves file to wrong location

Categories

(Firefox OS Graveyard :: Simulator, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: RobertC, Unassigned)

Details

(Whiteboard: [fromAutomation])

"Save image" action from browser saves the file to the Downloads folder from the OS instead of the path specified with 'device.storage.overrideRootDir' STR (from the test): 1. open browser 2. got to www.google.com -> images 3. search firefox 4. open one image, right-click 5. save image Expected result: Image is saved to the path specified in device.storage.overrideRootDir Actual result: Image saved notification appears, but the image is saved in the Downloads folder from the OS. Build was downloaded from http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/en-US/ on 30-oct-2014.
Flags: needinfo?(dhylands)
It looks like the GetDownloadDirectory function used by the browser only uses DeviceStorage on Gonk devices: http://dxr.mozilla.org/mozilla-central/source/uriloader/exthandler/nsExternalHelperAppService.cpp?from=GetDownloadDirectory#331-379 Perhaps this logic needs to be moved into here: http://dxr.mozilla.org/mozilla-central/source/b2g/components/DirectoryProvider.js ?
Flags: needinfo?(dhylands)
I would imagine bug 996619 fixed that by always setting device.storage.overrideRootDir. (wasn't the case before) Could you give it a try on a nightly build? http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/ (See the .xpi file at end of this page)
Flags: needinfo?(robert.chira)
The issue is still reproduced on the following build from 01/19/2015: b2g-38.0a1.en-US.linux-x86_64 http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/en-US/ The result is the same, the file is saved to the download folder from the OS (Ubuntu) instead of the temp folder which we pass as argument to device.storage.overrideRootDir. Alexandre, could the issue be unrelated to the bug you linked in comment 2?
Flags: needinfo?(robert.chira) → needinfo?(poirot.alex)
Oh right, I read comment 1 too quickly... Dave, it looks more like a device storage bug than a simulator one. The simulator / b2g-desktop now correctly and always set an overrideRootDir. Do you think you could provide a patch against nsExternalHelperAppService.cpp and/or DirectoryProvider.js to make it work nicely on desktop?
Flags: needinfo?(poirot.alex) → needinfo?(dhylands)
I tried to reproduce using the lastest B2G-Desktop on master and when I tried to save an image in the browser I got the following error: JavaScript error: chrome://global/content/BrowserElementChildPreload.js, line 912: TypeError: content.document.body is null JavaScript error: file:///home/work/B2G-desktop/moz-central-build/dist/bin/components/nsHelperAppDlg.js, line 209: NS_ERROR_NOT_AVAILABLE: Async version must be used JavaScript error: , line 0: uncaught exception: 2147500033 I did verify that sdcard and pictures were both pointing to a directory named storage inside my profile. oh - downloading an mp3 file saved it in ~/Downloads, so I've got something I can look at. I don't think that this is a device storage issue. I think that the problem is that the browser is completely bypassing device storage.
Flags: needinfo?(dhylands)
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.