Not able to use YT iframe api while making my extension due to CSP Directive

173 views
Skip to first unread message

Srijan Maurya

unread,
Oct 22, 2024, 11:08:46 AM10/22/24
to Chromium Extensions
I am building an chrome extension, what i wanted to do is create and extension that runs youtube iframe api in background so that i can extract data from the youtube video about and display on my extension. But on running the YT iframe script i am reciving error

Refused to load the script 'https://m.youtube.com/youtube_iframe_api.js' because it violates the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

How should I get rid of this error problem, can i get some suggestions?

Patrick Kettner

unread,
Oct 22, 2024, 12:06:54 PM10/22/24
to Srijan Maurya, Chromium Extensions
Hello Srijan,
Have you added the domain to your host_permissions?

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/caf9e693-fe9d-4540-ab71-07a6c5353557n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages