My favorites | Sign in
Logo
             
New issue | Search
for
| Advanced search | Search tips
Issue 22152: <audio> tag doesn't work for extension resources
9 people starred this issue and may be notified of changes. Back to list
 
Reported by aa@chromium.org, Sep 17, 2009
If a chrome extension tries to reference an audio tag that is packaged inside 
it, it doesn't play.

Chrome extensions serve their resources over chrome-extension://... I'm not 
sure how, but this probably has to do with the problem.
Comment 1 by aa@chromium.org, Sep 17, 2009
Andrew, you can try to reproduce this by doing this:

- create an empty directory on your system
- put an html and audio file inside it
- set the html file up to reference the audio file (using a relative url)
- go to chrome://extensions and click "load unpacked extension", then select the new 
directory

This should reproduce the issue.
Comment 2 by scherkus@chromium.org, Sep 17, 2009
Will look into it.
Labels: -Audio Video
Comment 3 by hc...@chromium.org, Sep 17, 2009
<audio> and <video> accepts file://, http:// and https:// explicitly, looking into how 
to enable other protocols in a sensible way.
Comment 4 by scherkus@chromium.org, Sep 17, 2009
hclam and I chatted a bit.. we whitelisted protocols since we abuse the heck out of the 
resource loader with range requests

the code's advanced a bit since then, so we'll plan to remove the whitelist.. need to 
make sure it doesn't introduce any bugs/security regressions
Comment 5 by hc...@chromium.org, Sep 17, 2009
Just did a simple check to make sure passing random protocol browser is ok:

<img src="whatever://bogus.jpg"></img>

And I see that the request is passed along to the browser process, I'll do the same for 
<audio> and <video>.
Owner: hc...@chromium.org
Comment 6 by bugdroid1@chromium.org, Sep 17, 2009
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=26532 

------------------------------------------------------------------------
r26532 | hclam@chromium.org | 2009-09-17 17:49:42 -0700 (Thu, 17 Sep 2009) | 8 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/media/buffered_data_source.cc?r1=26532&r2=26531

Remove whiltelist checks for protocol for <audio> and <video>

BUG=22152

Allow <audio> and <video> to request urls with protocol not limited
to file, http and https.

Review URL: http://codereview.chromium.org/212011
------------------------------------------------------------------------

Comment 7 by aa@chromium.org, Sep 19, 2009
Assuming this is fixed. Please correct if wrong.
Status: Fixed
Comment 8 by hc...@chromium.org, Sep 19, 2009
Not yet fixed, I need to land http://codereview.chromium.org/216022/show and will
declare this as fixed.
Status: Started
Comment 9 by aa@chromium.org, Sep 19, 2009
Oops, sorry :).
Comment 10 by bugdroid1@chromium.org, Sep 21, 2009
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=26746 

------------------------------------------------------------------------
r26746 | hclam@chromium.org | 2009-09-21 14:58:58 -0700 (Mon, 21 Sep 2009) | 15 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/renderer_glue.cc?r1=26746&r2=26745
   M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/media/buffered_data_source.cc?r1=26746&r2=26745
   M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/webkit_glue.h?r1=26746&r2=26745
   M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/test_shell/test_shell.cc?r1=26746&r2=26745

Allow <audio> to work in extension

BUG=22152
TEST=use <audio> extension with relative paths

We used to exclude file:// for checks for valid HTTP response but
since chrome extension resources use chrome-extension:// as scheme
response from such scheme require valid HTTP response.

This change changes the logic to limit the check for valid HTTP
response only for http:// and https:// schemes. This impose a
strong assumption that file://, ftp:// and new protocols need to
know how to handle range requests or at least know how to fail.

Review URL: http://codereview.chromium.org/216022
------------------------------------------------------------------------

Comment 11 by arufa.hc, Sep 21, 2009
This is fixed now. :)
Comment 12 by hc...@chromium.org, Sep 21, 2009
Oops.. different account.. but this is fixed now. :)
Status: Fixed
Comment 13 by alphapolitan, Dec 13, 2009
The users of my extension report that my extension produces no sound.

The audio file is local, inside the extension. 

This is the audio object I placed in the body of the html file I display in a new window: 
<audio src="chime.mp3" autoplay="autoplay"></audio> 

I open the new window from the background page with the following code: 
chrome.windows.create({url: "done.html", width: 500, height: 500});

The following is my extension, so the bug can be reproduced. 

https://chrome.google.com/extensions/detail/hepmlgghomccjinhcnkkikjpgkjibglj

1. Install the extension
2. Click the Timer icon in the toolbar
3. In the popup, click the custom radio button, type in 1 and click set
4. The timer does not play a sound when the new window pops up.

I can't reproduce the bug, for some reason it works for me. But a lot of my users say the sound 
does not work, even though they've checked the sound on their computers.
Comment 14 by jerem.se...@gmail.com, Dec 18, 2009
Seems to be not fully fixed. 

1. Load an unpacked extension
2. Try to play an audio tag placed in the background page
3. No sounds, if I set an URL as src of the audio tag like src="http://somemp3 it 
works, if I set relative local path of the extension like src="somemp3" it does not 
work.

Comment 15 by convincedd, Dec 18, 2009
related to that:

on background.html and options.html
works:
var music = new Audio('http://xzy.mp3');music.play();

does not work:
var music = new Audio('chrome-extension://xzy.mp3');music.play();

Comment 16 by scherkus@chromium.org, Dec 22, 2009
Thanks for the report and repro steps!  I've created bug 31024 to track this issue.
Comment 17 by erikkay@chromium.org, Mar 03, 2010
(No comment was entered for this change.)
Labels: Feature-Extensions
Sign in to add a comment

Powered by Google Project Hosting