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

Issue 740097 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

Event page unloaded during playing of audio

Reported by vitaly.z...@gmail.com, Jul 7 2017

Issue description

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

Steps to reproduce the problem:
Create event page that plays audio through new Audio(src).play()

What is the expected behavior?
Audio played until the end of the file.

What went wrong?
Event page unloaded after few seconds. I see in Task Manager that my extension go away. When developer tools opened - extension is always in memory.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 59.0.3071.115  Channel: stable
OS Version: OS X 10.12.5
Flash Version:
 
To prevent unloading I tried this:

chrome.runtime.onSuspend.addListener(() => {
  (function _doNotSleep() {
    if (audioCurrent) {
      setTimeout(() => {
        fetch('localhost/i-am-not-a-sleep'); 
        console.log(1);
        _doNotSleep();
      }, 1300);
    }
  })();
});

Without success. Can you suggest some workaround?

Comment 3 by woxxom@gmail.com, Jul 7 2017

The documentation says chrome.runtime.onSuspend is only for a quick synchronous cleanup.
It can't prevent a suspend.

Try using your _doNotSleep function without the listener.
Thank you, _doNotSleep() outside of the listener prevent unloading - but not with console.log() but with fetch().

Comment 5 Deleted

I found that for preventing of unloading in the background I can do only fetch() to some resource but this is not a good solution to leave such code for production - even making GET to the localhost can accidentally run some process on the user machine.
I found that instead of GET to some web resource or even localhost I can make `fetch(chrome.runtime.getURL('manifest.json'))` that is safe and also prevent unloading.
Components: Blink>Media>Audio
Labels: Needs-Feedback
Tested this issue using #59.0.3071.115 on Mac 10.12.5 and was unable to reproduce the issue as per the steps mentioned in comment #0.

@vitaly: Could you please find the attached screen cast and let me know if we missed any steps from our end. If possible please attach a expected screen cast for further triaging of the issue.

Thanks!!
  
Jul 11 2017 2-46 PM.webm
3.2 MB View Download
`
Steps to reproduce the problem:
Create event page that plays audio through new Audio(src).play()
`

...I wrote code snippet to reproduce such case but now audio playing without a problem... I will try again in a few days...
Project Member

Comment 11 by sheriffbot@chromium.org, Jul 11 2017

Cc: sandeepkumars@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I found that this reproducible not with every audio file but from few...

The code is:
manifest.json:
{
    "name": "test",
    "version": "11.07.2017.1",
    "manifest_version": 2,
    "background": {
      "scripts": ["eventPage.js"],
      "persistent": false
    },
    "permissions": ["contextMenus"]
}



eventPage.js:
chrome.contextMenus.create({
  title: 'title',
  id: 'myContextMenuItem',
});

chrome.contextMenus.onClicked.addListener(() => {
  new Audio('https://s3-eu-west-1.amazonaws.com/audio-chunks/amzn1.account.AELY2LYX4N7F3RNVAQY6DDZUTWCQ/03887e2377c3babe52260c0941836676/1d2d90fd60261ca6db0b9f7f2e7d7b49').play();
});
Requesting Blink>Media>Audio team for further triaging of the issue.

Thanks!!
Components: -Blink>Media>Audio Internals>Media>Audio
Components: Platform>Extensions
+extensions folk. I have no idea.
Labels: Needs-Milestone

Comment 17 by ajha@chromium.org, Aug 1 2017

Cc: ajha@chromium.org
Labels: Needs-Feedback
Could you please provide any Test URL with the test case from C#12 for easier repro and for checking if this has regressed or not.
Status: WontFix (was: Unconfirmed)
no response from reporter@ for > 1 month. no test url is provided. close it.
Sorry again, here is the link for the longer audio - better for tests - because on the short audio extension may not be unloaded during playing.

https://s3.amazonaws.com/intelligentspeaker--audio/07997975f557798a53a2ebcd83c56a31/5e4575652578620715ca28697ff2024c
I tested again on macOS, Google Chrome Version 61.0.3163.79 (Official Build) (64-bit) - problem still here.
For easier reproducing you can use this minimal test extension - like the code above but with better naming and with alert() inside onSuspend().
extension-test--unloading-of-eventPage-during-playing.zip
1.2 KB Download
Cc: dalecur...@chromium.org
Components: -Internals>Media>Audio
Status: Unconfirmed (was: WontFix)
Project Member

Comment 24 by sheriffbot@chromium.org, Sep 12 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "ajha@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-64 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Ubuntu 14.04, Windows-10 and Mac OS 10.12.6 using chrome latest stable #62.0.3202.75. Installed the test extension provided in the comment #22, observed an alert saying event suspended while playing audio.

This issue is seen on older version of chrome #50.0.2624.0 as well, hence marking it as untriaged.

Thanks!
Owner: lazyboy@chromium.org
Status: Assigned (was: Untriaged)
Istiaque: can you take a look?

Sign in to add a comment