-
Notifications
You must be signed in to change notification settings - Fork 33
Improve logging in scriptlets — save reference to console #546
Open
Assignees
Description
Currently if website overrides console.log or other properties then logging does not work.
Steps to reproduce:
- Add to user rules:
example.org#%#//scriptlet('prevent-setTimeout') example.org#%#//scriptlet('log-on-stack-trace', 'document.querySelectorAll')
- Go to - https://example.org/
- Run in console:
const noopFunc = ()=>{}; console.log = console.table = noopFunc; setTimeout(()=>{const ads = {};}); const adblock = ()=>{ document.querySelectorAll('p'); }; adblock();
Scriptlets should log information to console.
There is nothing in console because console.log and console.table have been overridden.
Screenshot
ImageIt works fine if console.log = console.table = noopFunc; is commented out.