I have a question about how to change web pages with a Chrome extension.
After reading some info I think the question is how to manipulating the DOM. Let's say I open www.stackoverflow with Chrome and want to replace the following line of code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
and replace it with:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
My question is not if it's a smart thing to do, but how to do this?
Try to modify you manifest's file run_at string.
In the case of "document_start", the files are injected after any files from css, but before any other DOM is constructed or any other script is run.
https://developer.chrome.com/docs/extensions/mv2/content_scripts/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With