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

Issue 801944 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Audio continues to play from video within an extension after Chrome closes

Reported by johannbl...@gmail.com, Jan 15 2018

Issue description

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

Example URL:
https://www.liveleak.com/view?i=982_1514974077

Steps to reproduce the problem:
The audio on videos continues to play even if you close the browser tab or even close Chrome altogether. This happens mostly on videos on Liveleak.com although I've occasionally seen it happen on other sites too. Even if it does happen on a video on Liveleak, it isn't always repeatable for the same url.

What is the expected behavior?
The audio should stop immediately when the video stops or is paused or when the the browser tab is closed.

What went wrong?
The audio continues to play.

Did this work before? N/A 

Is it a problem with Flash or HTML5? N/A

Does this work in other browsers? N/A

Chrome version: 63.0.3239.132  Channel: stable
OS Version: OS X 10.13.1
Flash Version: Shockwave Flash 28.0 r0

Contents of chrome://gpu: 

This issue has been in Chrome for many versions already.
 
When this happens, open Activity Monitor, can you see there is any Chrome process remains?
Assuming there must are, how many of them remain? And how many extensions do you have.
Labels: Needs-Triage-M63
Cc: sc00335...@techmahindra.com
Labels: Needs-Feedback Triaged-ET
johannblake@g Thanks for the issue.

Tested this issue on Windows 10 and Mac OS 10.12.6 on the latest Canary 65.0.3322.3 and Stable 63.0.3239.132 and unable to reproduce this issue by following the below steps.

1. Launched Chrome and navigated to https://www.liveleak.com/view?i=982_1514974077
2. Played the video foe a while and closed the tab.
The audio stops playing on closing the tab and no issue is observed.

Request you to please retry the issue on a new Chrome profile without any flags/extensions and update the thread with the observations.

Thanks..
I have isolated the problem to an extension I developed. I will do some further tests to determine where in the extension this is causing the problem and report back as soon as possible.
Project Member

Comment 5 by sheriffbot@chromium.org, Jan 16 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sc00335628@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
In my extension's background script, I use the jQuery get function to retrieve the html content for the url that is currently in the selected tab. To repeat the bug, click on the link to the LiveLeak url:

https://www.liveleak.com/view?i=982_1514974077

Don't copy and paste the link into an existing tab. You need to have the tab activated so that the onActivated event in the background script gets called. In the extension's background script, include the following code:


chrome.tabs.onActivated.addListener(function (info) {
    chrome.tabs.get(info.tabId, function (tab) {
        $.get(tab.url, function (html) {

        });
    });
});

The $.get function is clearly causing a problem. Not only will the audio in the video continue to play even after the tab is closed or the browser is closed, the audio will often play double, i.e., two streams of the audio play overlapped and slightly out of sync. In case you're wondering why I download the current html instead of accessing it through the content script, it has to do with the fact that Chrome can often take a considerable amount of time for the html to be downloaded before it makes things like meta tags available. Unfortunately, this time would be unacceptable for the purpose of the extension. By retrieving the html directly, the meta tags are available very quickly.

Also note that this bug in Chrome only seems to exists for videos that autoplay. I have however only been able to verify this with videos in LiveLeak. If you launch this video from LiveLeak instead:

https://www.liveleak.com/view?i=810_1516082569

the bug is not present because this video does not have autoplay.

Labels: Needs-Feedback
johannblake@ Thanks for the feedback.

As per comment #6, can you please provide the test extension where this issue is seen, which will help in further triaging.

Thanks..


I created a test extension. After installing the extension, open the following url in Chrome:

https://www.liveleak.com/view?i=982_1514974077

The audio will play 2 or more times overlapped and out of sync. Closing the tab or closing Chrome does not terminate the audio.

Line 17 in background.js is the line of code causing the problem. If you comment that line out, the problem goes away.
TestAutoplayBug.zip
34.6 KB Download
Project Member

Comment 9 by sheriffbot@chromium.org, Jan 17 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sc00335628@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Able to reproduce the issue on reported chrome version 63.0.3239.132 and on the latest canary 65.0.3324.0 using Mac 10.13.1, Windows 10 and Ubuntu 14.04. As the issue is seen from M50(50.0.2661.0) considering it as non-regression and marking it as Untriaged.

Thanks!
Cc: viswatej...@techmahindra.com
Labels: M-65 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Components: -Internals>Media Internals>Media>Audio
Owner: dalecur...@chromium.org
Status: Assigned (was: Untriaged)
 Since this bug repro after install the user customized extension, I am not sure if it is anything Chrome can change.
Dale, can you take a look?
repro step and extension are in on c#8.
I don't understand why this is a bug in Chrome. If the extension starts audio or video it's up to the extension to handle control of that playback. There's lot of extensions which legitimately need playback controls, so we can't blindly stop such playbacks.

Can you provide some more detail on why you think this is a Chrome bug?
Who said that this extension is starting an audio or video? Nothing in any of the posts I made indicated this. The extension simply retrieves the html from some url. Chrome is duplicating the audio track in the current tab and even preventing it from terminating, even after Chrome closes. That is clearly a bug in Chrome. Downloading any html content in an extension's background script should not have any affect on what is being playing in the current tab.
Cc: dalecur...@chromium.org
Components: -Internals>Media>Audio Platform>Extensions
Owner: ----
Status: Untriaged (was: Assigned)
Summary: Audio continues to play from video within an extension after Chrome closes (was: Audio continues to play from video after Chrome closes)
Any instantiation of HTML by the extension in the background process is the same as if the extension did so itself. If you expect the source to only be downloaded and not parsed, it seems something is awry in the extension.

In any case, +extensions folks who will know more here.
Looking at the code, you're definitely intentionally instantiating the downloaded in page in the extensions process so this is WAI I believe. Extensions are allowed to continue running past Chrome exit (that's how background Apps work), but I defer to the extensions team to comment.
Yet the documentation on extensions clearly states that background scripts cannot interact with the DOM - hence the provision of content scripts. This bug really only appears with the liveleak site, although there are probably other sites out there that do the same. It doesn't manifest itself with YouTube, Vimeo, and other video sites I've tested with.

Downloading the html is clearly not the issue but the line of code that wraps the html in a div using jQuery. This isn't instantiating a DOM object that is part of the DOM (or at least it shouldn't be). Even in normal html, wrapping any kind of html in a $ doesn't actually add it to the DOM. It has to be inserted using some jQuery method. No inserting is carried out here.
Sorry I don't know enough about jQuery to advise you here. I'd be suspicious of the $ function though, probably the code should be something like let doc = div + html + /div to avoid processing.
You cannot use:

let docu = div + div + html + /div

That is not a jQuery object. A jQuery object is required in order to process the html. There are other solutions and I will investigate them but this is still clearly a bug in the extension. Instantiating any kind of jQuery object should not affect what goes on in a browser's tab let alone prevent Chrome from terminating the audio when Chrome is shut down.
Status: Available (was: Untriaged)

Sign in to add a comment