New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 766303 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

chrome.downloads.download API does not work in incognito mode (with extension)

Reported by dtev...@gmail.com, Sep 18 2017

Issue description

UserAgent: 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:
 
DownloadBroken.zip
1.4 KB Download
Cc: keerthan...@techmahindra.com
Components: Platform>Extensions
Labels: Triaged-ET M-63 Needs-Milestone
Status: Untriaged (was: Unconfirmed)
Able to reproduce on reported version 60.0.3112.113, latest canary 63.0.3219.0 and on latest stable 61.0.3163.91 with the below mentioned steps on Ubuntu 14.04, windows 7 and Mac 10.12.6.
1. Loaded the extracted attached file into chrome://extensions.
2. Opened an Incognito window and tried to download.
3. On the download bar, got Failed- No file message.

This seems to be a Non-Regression issue seen from M-50[50.0.2624.0]. Hence, marking it as Untriaged.
Labels: OS-Linux OS-Mac
Cc: nick@chromium.org rdevlin....@chromium.org nasko@chromium.org
Owner: benjhayden@chromium.org
Status: Assigned (was: Untriaged)
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.
Cc: rhalavati@chromium.org
Components: Privacy>Incognito
Owner: dtrainor@chromium.org
I've moved off of downloads and forgotten this code. Redirecting to dtrainor.
Owner: xingliu@chromium.org
xingliu@ can you take a look?
Cc: qin...@chromium.org
+qinmin@ for his recent work on the extensions API.
Status: Started (was: Assigned)
This can be repro on linux.
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

Comment 11 Deleted

Comment 12 Deleted

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