Loading objectUrl of video blob in content script refused due to content security
125 views
Skip to first unread message
Bala Abhinav
unread,
Jun 20, 2024, 6:38:50 AM (9 days ago) Jun 20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions
Hello,
I am building an extension on MV3 where I record video using the mediaDevices API in an offscreen document and display it on the page using a video element in my content script. I am using URL.createObjectURL to generate the url in the offscreen document before passing it onto the content script but I am getting a content security error (attached below) : Refused to load media from 'blob:blob-url' because it violates the following Content Security Policy directive: "media-src 'self' archive.org
Is there a chrome extension "native" way of making this work or should I go for the "iframe" hack described in one of the other conversation threads ? Any other solutions are welcome.
Thanks
woxxom
unread,
Jun 20, 2024, 10:11:39 AM (9 days ago) Jun 20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, Bala Abhinav
Normally it should just work, so I guess it's a bug in Chrome or your content script uses MAIN world? Re-create the blob URL in a normal content script in the default world like URL.createObjectURL(await (await fetch(blobUrl)).blob()) and then use dispatchEvent (example).