CoreLibs icon indicating copy to clipboard operation
CoreLibs copied to clipboard

Allow to remove content with empty attribute

Open AdamWr opened this issue 1 year ago • 0 comments

Issue Details

For example, if there are 2 scripts like:

<script src="test1.js"></script>
<script src="test2.js" defer></script>

And we want to remove only this with defer attribute using rule like:

example.org$$script[src="test"][defer]

Then it doesn't work.

Steps to reproduce:

  1. Add these rules:
||example.org^$replace=/<\/head>/<script src="test1.js"><\/script><script src="test2.js" defer="abcd"><\/script><\/head>/,document
example.org$$script[src="test"][defer]
  1. Go to - https://example.org/

Script with defer attribute should be removed.

Proposed solution

Allow to remove content with empty attribute so mentioned rule will remove only this script which has defer attribute.

Alternative solution

No response

AdamWr avatar Nov 25 '24 13:11 AdamWr