chrome.downloads.download API does not work in incognito mode (with extension)
Reported by
dtev...@gmail.com,
Sep 18 2017
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 Steps to reproduce the problem: 1. Load the DownloadBroken extension 2. In Chrome, go to incognito mode 3. Open the extension, click the download button. Nothing happens. What is the expected behavior? A file called "dummyFile.html" should be created in the downloads folder. Note. The file is be created when not running in incognito mode. What went wrong? No file is created. Note, I run the extension with the developer window open, the "Download" icon appears in the bottom of the screen with a random GUID as the filename and the error message "Failed - no file". Did this work before? N/A Does this work in other browsers? N/A Chrome version: 60.0.3112.113 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Sep 19 2017
,
Oct 20 2017
Fun! This is interesting. I suspect the reason this happens is because the download request is originating from the extension process, which is an on-the-record process for spanning-mode extensions, which are the default. Then, when we try to download a file from it, we fail, because there's a mismatch in expectations there (I haven't tracked down the exact spot yet - still wading through download code). I've confirmed that if you set the incognito mode of the extension to "split", so that the process that initiates the download is an off-the-record process, the extension works in both incognito and on-the-record windows. Assigning to benjhayden@ as owner of the downloads API, and cc some process gurus in case they have ideas or are interested.
,
Apr 16 2018
,
Apr 20 2018
,
Apr 20 2018
I've moved off of downloads and forgotten this code. Redirecting to dtrainor.
,
Apr 23 2018
xingliu@ can you take a look?
,
Apr 23 2018
+qinmin@ for his recent work on the extensions API.
,
Apr 25 2018
This can be repro on linux.
,
Apr 25 2018
The URL for extension in incognito mode currently uses "blob:chrome-extension//" schema, where network stack yields FILE_NOT_FOUND error for some reason.
Log:
:download_request_core.cc(392)] OnResponseCompleted() { this=0xcfe633fe790 url_ = "blob:chrome-extension://dnpfdogidiapommpboahbmkljooanhgh/5e935d5f-25d9-407f-a9c0-f254c4053f78" } status.status() = 3 status.error() = -6 response_code = 0
,
Apr 30 2018
Comment #3 is probably correct, the extension blob in incognito is saved in normal profile's blob storage, but the download system and url request are using incognito profile, and fails to find the blob in incognito profile's blob storage in: https://chromium.googlesource.com/chromium/src/+/68.0.3415.1/content/browser/loader/resource_dispatcher_host_impl.cc#2117 Notice that the blob storage context is glued to a resource context and browser context as UserData. It's very hard to fix in download code, that even I can find the blob data handle from normal profile in incognito mode, the download result will appear in the normal window instead of incognito window. So I guess the correct solution is probably to make the extension process uses incognito profile? |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by keerthan...@techmahindra.com
, Sep 19 2017Components: Platform>Extensions
Labels: Triaged-ET M-63 Needs-Milestone
Status: Untriaged (was: Unconfirmed)