Steps to reproduce:
- Add to user rules:
example.org#%#//scriptlet('trusted-replace-argument', 'Element.prototype.setAttribute', '1', 'replace:/whatever/test/g')
- Navigate to https://example.org/
- Run in console:
const h1 = document.querySelector('h1');
const value = 1234;
h1.setAttribute('data-attr', value);
console.log(h1.getAttribute('data-attr'));
It should logs 1234 in console, but content is replaced and it logs test.
When value is a string ('1234') then it works correctly.
Steps to reproduce:
It should logs
1234in console, but content is replaced and it logstest.When
valueis a string ('1234') then it works correctly.