Christopher.Burkhouse Posted April 21, 2015 Share Posted April 21, 2015 So here's my problem. I'm trying to test my website for exploits. What I'm testing for requires me to modify some JS at startup. I tried in the dev tools 'inspect element' section of Chrome, but refreshing, as I'm sure you all know, resets the JS. What I need is to replace a JS page (it links to an external JS page) with my own (or remove the one included and include my own between the header). Is there a tool which allows this? I imagine if a tool let's you replace /js/functions.js with a local functions.js, this would be the easiest route. My problem is I haven't found anything that works. I hope I'm making sense. If I don't, please let me know what I can clarify. I'm pretty new to JS injection in this form. It just needs to inject the JS at page load hence the need to be able to refresh and have it use my specific JS from the get-go. Link to comment Share on other sites More sharing options...
Ingolme Posted April 21, 2015 Share Posted April 21, 2015 In the DOM inspector, you can change the src attribute of any <script> element on the page. If you want to execute your own Javascript on the page you can write code right into the console. Link to comment Share on other sites More sharing options...
Christopher.Burkhouse Posted April 21, 2015 Author Share Posted April 21, 2015 That doesn't work in this case, though. I need to stop the page from pulling a specific JS file, and use mine instead, so I can customize the functions. Is something like this even possible? To explain, I can't modify the JS after the page has been loaded, I need my JS to load with the page. It's because of the way the functions operate. Link to comment Share on other sites More sharing options...
Ingolme Posted April 21, 2015 Share Posted April 21, 2015 I actually don't know of a way to do that dynamically. That would require preprocessing the HTML before the browser begins parsing it. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 22, 2015 Share Posted April 22, 2015 You might be able to use a breakpoint to pause execution and let you change something before continuing. Link to comment Share on other sites More sharing options...
davej Posted April 22, 2015 Share Posted April 22, 2015 Greasemonkey? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now