My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 104853: chrome.tabs.executeScript stops working after downloading a file from a link on a page
8 people starred this issue and may be notified of changes. Back to list
Reported by, Nov 18, 2011
Chrome Version       : 16.0.912.41
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5: N/A
  Firefox 4.x: N/A
     IE 7/8/9: N/A

What steps will reproduce the problem?
1. Create an extension that calls this.

chrome.tabs.executeScript(null, { code: "alert('hello')", allFrames: true }, function () { console.log("alert completed"); });

2. Run the extension on a page that has direct file download links, and confirm the alert box appears. (eg.

3. Click a link to download a file.

4. Run the extension and confirm that the alert box no longer appears and that the executeScript() is no longer executing script on the page.

What is the expected result?
I expect executeScript to continue working after downloading a file from a page.

What happens instead?
executeScript stops working, never to be seen again.

Please provide any additional information below. Attach a screenshot if

UserAgentString: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.41 Safari/535.7

Thanks, love you work.

Nov 22, 2011
(No comment was entered for this change.)
Labels: -Area-Undefined Area-Internals Feature-Extensions
Nov 30, 2011
I can't reproduce this. What do you do when you say "run the extension" to insert the script into the page? It seems like you're injecting the script more than once, and how this happens is important. It would help if you could provide a complete sample extension that shows this behavior.

I experimented with an extension that injects a script that keeps doing something; it continues to run after hitting a download link.
Labels: Action-FeedbackNeeded
Nov 30, 2011
I'll create an extension that duplicates the issue tonight (my TZ) and attach it.
Dec 1, 2011
Attached is a chrome extension zip file which demonstrates the issue.

To use this extension, visit a web site that has direct file downloads (eg.

Then right click anywhere on the page.  You will see a "ProofOfConcept" menu item, and under that you will see "executeScript" and "console.Log" menu items.

Click each menu item. --> They both work.
Click a file to download on the site (you can 'Discard' the download)
Click the "executeScript" menu item again. --> It will no longer work.
1.1 KB   Download
Dec 2, 2011
Thanks for the report. I experimented with this a bit; your description is correct. (Other means of injecting, such as via clicking a browser action, also don't work.)

After hitting a download link, ExecuteCodeInTabFunction::RunImpl looks like it's still returning true, but the tabs.executeScript callback (none given in the example extension) also doesn't get called.
Summary: chrome.tabs.executeScript stops working after downloading a file from a link on a page
Status: Available
Labels: -Action-FeedbackNeeded -OS-Windows Mstone-18 OS-All
Feb 7, 2012
(No comment was entered for this change.)
Labels: MovedFrom18 Mstone-19
Feb 28, 2012
Looks like this is because ExtensionHelper is calling DidStartProvisionalLoad on UserScriptIdleScheduler which is resetting has_run_.

Basically, USIS thinks that it is navigating to a new page and it should restart for a new page.

I will take on this one.
Status: Started
Feb 28, 2012
(No comment was entered for this change.)
Mar 26, 2012
(No comment was entered for this change.)
Labels: -Pri-2 -Mstone-19 Pri-3 Mstone-20
Apr 27, 2012
We're too close to the branch point for any more Pri 3 bugs.  If you believe one of these needs to be in M20, please adjust the mstone and priority.
Labels: -Mstone-20 Mstone-21 MovedFrom-20
May 15, 2012
I found relatively nice workaround (open the installation link into the hidden iframe):

<iframe name="install" style="display: none"></iframe>
<a href="Extension.crx" target="install">Install</a> 

The executeScript than works.
Jul 11, 2012
Moving all non essential bugs to the next Milestone
Labels: -Mstone-21 MovedFrom-21 Mstone-22
Aug 30, 2012
Moving all non-blocking 22 issues to 23.
Labels: -Mstone-22 MovedFrom-22 Mstone-23
Oct 10, 2012
Moving all non essential bugs to the next Milestone
Labels: -Mstone-23 MovedFrom-23 Mstone-24
Nov 5, 2012
Since the bug has moved few times, removing the milestone label. Please target the right milestone.
Labels: -Mstone-24
Mar 10, 2013
(No comment was entered for this change.)
Labels: -Area-Internals -Feature-Extensions Cr-Internals Cr-Platform-Extensions
Sign in to add a comment

Powered by Google Project Hosting