Skip to content

Commit 4697764

Browse files
authored
apply 'strict-origin-when-cross-origin' referrer-policy to address Error 153 (#203)
1 parent 1b88628 commit 4697764

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lite-yt-embed.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ class LiteYTEmbed extends HTMLElement {
201201
iframeEl.title = this.playLabel;
202202
iframeEl.allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';
203203
iframeEl.allowFullscreen = true;
204+
// Required by Youtube to fix Error 153
205+
iframeEl.referrerPolicy = 'strict-origin-when-cross-origin';
204206
// AFAIK, the encoding here isn't necessary for XSS, but we'll do it only because this is a URL
205207
// https://stackoverflow.com/q/64959723/89484
206208
iframeEl.src = `https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${this.getParams().toString()}`;

0 commit comments

Comments
 (0)