I don't know if you need this to save forever, but if you just need to temporarily change js:
I can copy this javascript that I want to change into a text editor, edit it, and then paste it into the console and override any functions or anything else that I need to override.
for example, if the page has:
<script> var foo = function() { console.log("Hi"); } </script>
I can take the content between the script, edit it, and then enter it into the debugger, for example:
foo = function() { console.log("DO SOMETHING DIFFERENT"); }
and it will work for me.
Or, if you have,
function foo() { doAThing(); }
You can simply enter
function foo() { doSomethingElse(); }
and foo will be overridden.
This is probably not the best workaround, but it works. It will last until the page reloads.
byronaltice Mar 26 '15 at 19:38 2015-03-26 19:38
source share