Scriptlets icon indicating copy to clipboard operation
Scriptlets copied to clipboard

Fix 'click2load.html' — redirect does not work correctly in the extension

Open AdamWr opened this issue 1 year ago • 1 comments

It seems that click2load.html redirect doesn't work correctly in the extension. Related to - https://github.com/AdguardTeam/AdguardFilters/issues/179334

Steps to reproduce:

  1. Add this rule:
embed$subdocument,redirect=click2load.html,important
  1. Go to - https://example.org/
  2. In browser console run:
(() => {
  const video = '<iframe width="560" height="315" src="https://www.youtube.com/embed/Fy2rtb95QhY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
  const createDiv = document.createElement("div");
  document.body.appendChild(createDiv);
  createDiv.innerHTML = video;
})();
  1. Click on the button to load player

It looks like that script in click2load.html is blocked by Content Security Policy.

Screenshots

image

image

This issue doesn't occur in AdGuard for Windows, so I'm not sure if it's extension or scriptlets issue.

AdamWr avatar May 16 '24 09:05 AdamWr

Most likely this is an extension bug

ameshkov avatar May 16 '24 10:05 ameshkov