S
S
Stepgor2020-08-29 07:49:20
JavaScript
Stepgor, 2020-08-29 07:49:20

Why does the extension swear on the iframe?

I want to add an iframe to the background to listen to music from youtube (as far as I understand, there is hardly anything better than this)
But when adding an iframe to the code. It turns out this error:

A cookie associated with a cross-site resource at http://youtube.com/ was set without the `SameSite` attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with `SameSite=None` and `Secure`

When adding the same frame to localhost, everything is fine.
The csp manifest is written like this:
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'; frame-src 'self' https://www.youtube.com/;"

Frame:
<iframe width="400" height="300" src="https://www.youtube.com/embed/9Ht5RZpzPqw" allow="encrypted-media" allowfullscreen=""></iframe>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VPVPVP, 2020-08-29
@VPVPVP

Add a response header
response.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question