0
I want to make changes through the sources tab in Inspect Elements and want to see a preview quickly without refreshing the browser.
Is there a way to do this?
For example, in JavaScript I have a variable:
var abc = 'xyz';
But through the Sources tab, I got to my script file and changed the code:
var abc = 'hello world';
Now if I try alert(abc) then, will it show latest changes? I don't want to refresh to see this change.
Is there any kind of possibility or plugin that can do this? Because sometimes this is very time saving. For example, each time I test I have to do a lot of steps to see some value or response. So for making a minor change I have to change it in the original file and refresh again to see it and this way I always have to go through the complete process that wastes a lot of time.

Thanks for your message. I tried your method but that did not work.
I added a function through sources tab and called that function from console but it said undefined – user2899728 – 2016-09-06T00:02:00.863
I updated my answer above with a sample screenshot and explanation. – Atzmon – 2016-09-06T07:21:17.170
I know that it is possible to update function through console. But I want to change from existing source in the source tab or some other way like that. Because sometimes I have very complex and long functions that normally cannot be pasted in console. So is there any better way for that ? – user2899728 – 2016-09-06T08:13:27.460
Yes. Assuming your javascript is in external files (not embedded script chunks in the HTML), put a breakpoint before the part you want to change, then when the debugger hits that breakpoint simply change the source within the Sources tab and continue debugging. Your new code will run. Be advised that this does not change your actual code files (your changes will be gone when you refresh or exit Chrome). – Atzmon – 2016-09-06T09:02:58.563