Skip to content

Commit 4b05cfc

Browse files
committed
Fix youtube referrer policy issue
1 parent 1d6eded commit 4b05cfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

event/main_listener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ public function modify_tag_templates($event)
166166
{
167167
try
168168
{
169-
// force YouTube to use the no cookies until the user starts video playback
169+
// force YouTube to use the no cookies until the user starts video playback, and fix referrer policy issues
170170
$tag = $event['configurator']->tags['YOUTUBE'];
171-
$tag->template = str_replace('www.youtube.com', 'www.youtube-nocookie.com', $tag->template);
171+
$tag->template = str_replace(['www.youtube.com', ' allowfullscreen'], ['www.youtube-nocookie.com', ' referrerpolicy="origin" allowfullscreen'], $tag->template);
172172

173173
$event['configurator']->finalize();
174174
}

0 commit comments

Comments
 (0)