Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically inject document.write tracker code into all async scripts #2

Open
eligrey opened this issue Jan 10, 2018 · 0 comments
Open

Comments

@eligrey
Copy link
Owner

eligrey commented Jan 10, 2018

This will make eval(document.write.START) and eval(document.write.END) unnecessary.

If the context is an async script element without an src containing text, add in text and run script.parentNode.replaceChild(document.importNode(script, true), script). I will need to disable document.write() entirely before executing the modified tracker code so that initial runs are ignored.

If the context is an async script element with an src, async XHR/Fetch the src, add tracker code, change src to blob URI for the new content, and run script.parentNode.replaceChild(document.importNode(script, true), script).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant