Event page unloaded during playing of audio
Reported by
vitaly.z...@gmail.com,
Jul 7 2017
|
|||||||||||||
Issue descriptionUserAgent: 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:
,
Jul 7 2017
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?
,
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.
,
Jul 8 2017
Thank you, _doNotSleep() outside of the listener prevent unloading - but not with console.log() but with fetch().
,
Jul 10 2017
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.
,
Jul 10 2017
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.
,
Jul 11 2017
,
Jul 11 2017
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
` 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...
,
Jul 11 2017
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
,
Jul 11 2017
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();
});
,
Jul 12 2017
Requesting Blink>Media>Audio team for further triaging of the issue. Thanks!!
,
Jul 17 2017
,
Jul 17 2017
+extensions folk. I have no idea.
,
Jul 26 2017
,
Aug 1 2017
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.
,
Sep 8 2017
no response from reporter@ for > 1 month. no test url is provided. close it.
,
Sep 12 2017
I am sorry to be late, test url for audio: https://s3.amazonaws.com/intelligentspeaker--audio/04cfff7c02b4d47592d8c4937dee90b5/04cfff7c02b4d47592d8c4937dee90b5
,
Sep 12 2017
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
,
Sep 12 2017
I tested again on macOS, Google Chrome Version 61.0.3163.79 (Official Build) (64-bit) - problem still here.
,
Sep 12 2017
For easier reproducing you can use this minimal test extension - like the code above but with better naming and with alert() inside onSuspend().
,
Sep 12 2017
,
Sep 12 2017
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
,
Nov 3 2017
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!
,
Nov 10 2017
Istiaque: can you take a look? |
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by vitaly.z...@gmail.com
, Jul 7 2017