My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
for
  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 matw...@gmail.com, 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. https://bitbucket.org/tortoisehg/hgtk/downloads)

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
possible.

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
#1 mihaip@chromium.org
(No comment was entered for this change.)
Labels: -Area-Undefined Area-Internals Feature-Extensions
Nov 30, 2011
#2 yoz@chromium.org
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.
Owner: yoz@chromium.org
Labels: Action-FeedbackNeeded
Nov 30, 2011
#3 matw...@gmail.com
I'll create an extension that duplicates the issue tonight (my TZ) and attach it.
Dec 1, 2011
#5 matw...@gmail.com
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. http://tortoisehg.bitbucket.org/download/windows.html)

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.
QED
ProofOfConcept.zip
1.1 KB   Download
Dec 2, 2011
#6 yoz@chromium.org
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
Owner: a...@chromium.org
Cc: mpcomplete@chromium.org yoz@chromium.org
Labels: -Action-FeedbackNeeded -OS-Windows Mstone-18 OS-All
Feb 7, 2012
#7 kar...@google.com
(No comment was entered for this change.)
Labels: MovedFrom18 Mstone-19
Feb 28, 2012
#8 eaugu...@chromium.org
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
#9 yoz@chromium.org
(No comment was entered for this change.)
Owner: eaugu...@chromium.org
Mar 26, 2012
#10 eaugu...@chromium.org
(No comment was entered for this change.)
Labels: -Pri-2 -Mstone-19 Pri-3 Mstone-20
Apr 27, 2012
#11 kerz@google.com
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
#12 meluzin....@gmail.com
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
#13 ka...@chromium.org
Moving all non essential bugs to the next Milestone
Labels: -Mstone-21 MovedFrom-21 Mstone-22
Aug 30, 2012
#14 kerz@google.com
Moving all non-blocking 22 issues to 23.
Labels: -Mstone-22 MovedFrom-22 Mstone-23
Oct 10, 2012
#15 ka...@chromium.org
Moving all non essential bugs to the next Milestone
Labels: -Mstone-23 MovedFrom-23 Mstone-24
Nov 5, 2012
#16 dhar...@google.com
Since the bug has moved few times, removing the milestone label. Please target the right milestone.
Labels: -Mstone-24
Mar 10, 2013
#18 bugdro...@chromium.org
(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