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

Issue 626197 link

Starred by 6 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

content_script injected >300 times on web page

Reported by tomac...@gmail.com, Jul 7 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce the problem:
1. Install disable HTML5 Autoplay extension
2. Goto this page:
3. Open inspector and go to the extension, find content_script.js and set a breakpoint on the line matching "if (!(play_authorized || play_pending)) ", approx. line 174

What is the expected behavior?
Normal breakpoint

What went wrong?
content_script.js is loaded in an infinite loop and the developer tools opens a new window for each. It also seems to break on the breakpoint (not visibly), because this locks up immediately. It recovers when the breakpoint(s) (it adds multiple breakpoints itself) are removed, but the tabs are still open and must be closed.

Did this work before? N/A 

Chrome version: 51.0.2704.103  Channel: n/a
OS Version: OS X 10.11.1
Flash Version: 

This is listed as a bug with the developer tools, however it is also very likely an issue with extensions.
 

Comment 1 by tomac...@gmail.com, Jul 7 2016

URL: goo.gl/qf8OjS
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
Labels: Hotlist-Polish
Cc: kozyatinskiy@chromium.org
Components: -Platform>DevTools Platform>Extensions
Labels: -Hotlist-Polish -OS-Mac
Owner: ----
Status: Untriaged (was: Assigned)
thanks for report!

I debugged this one. It looks like on the mentioned page (goo.gl/qf8OjS), content_scripts.js is injected more then 300 times and for each injected script 
we show separate tab.
So it's work as intended in DevTools, we have some ideas how we can merge tabs with same content but we are not working on this now.

Routed to extensions to verify that 300 times is reasonable amount of injected scripts.
Summary: content_script injected >300 times on web page (was: Developer tools crashes with infinite loop / locks up when breakpoint is added)

Comment 7 by tomac...@gmail.com, Oct 6 2017

As a hyopthetical extension developer, I think it would be important to be able to know how many times a script was injected. I mean in the sense of a notice or warning rather than a lockup.

I didn't develop that extension, but I'm guessing that the script has to be re-injected periodically. Only problem here sounds like the breakpoint is hitting on every injected script instead of just the latest.
Cc: rdevlin....@chromium.org
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)
To be clear, this is a script injected through chrome.tabs.executeScript (not an entry in the manifest under "content_scripts").  Injecting a script each time the API method is called is WAI, and sometimes injecting multiple times is necessary.  The main bug here is in the extension itself, since it's calling executeScript() far more frequently than is necessary (this is because it injects the script in all frames of the tab every time any navigation is committed anywhere in that tab - which for a tab with tens or hundreds of frames, is a lot).

We probably should find a way to throttle injections to some reasonable amount, but we'll probably need to add some metrics to determine what that "reasonable amount" is.

Comment 9 by tomac...@gmail.com, Oct 6 2017

That makes sense. I've been having some stalling on Youtube possibly due to that extension.

The extension is teribly written, but has some practical use. I hope Google will implement autoplay blocking to keep up with Safari.
Cc: emilyschechter@chromium.org raymes@chromium.org
raymes@ and emilyschechter@, is there any discussion of or appetite for autoplay videos as a content setting?  (This would allow users to customize it, and as a bonus, extensions could use the contentSettings API to make this work in a muuuuuch less hacky way!).
Cc: mlamouri@chromium.org
+mlamouri 

I think we have an autoplay setting on mobile but I don't think it does the same thing as the extension described.
Mobile setting isn't related indeed. We are introducing some content setting to block a tab from making sound but that's slightly different from blocking autoplay.
Project Member

Comment 13 by sheriffbot@chromium.org, Oct 10

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment