Reload a script/stylesheet in Chrome

Using Chrome's devtools, is it possible to reload just one (or more) of the scripts or stylesheets injected into a page without reloading the whole page? So, if I am on page.html that uses script.js and style.css, is it possible to reload, say, script.js, without refreshing page.html?


An easy way that should work with almost all stylesheets and images is to change the filename by adding an query to their url.

For example, in superuser, the css is:

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/superuser/all.css?v=a5d649727a07">

Change that to

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/superuser/all.css?v=a5d649727a07&refresh">

And get a reloaded (although the same) style rules.

This can be made into a bookmarklet or copied to the console

[].forEach.call(document.querySelectorAll("link[rel=stylesheet]"), function(link) {
   link.href+=(link.href.indexOf("?") > -1) ? "&refresh" : "?refresh";
})

As of scripts, you shouldn't. Almost all scripts are modifying the page on load or attaching themselves to some handler. You can easily load another js file, but the changes made by the one before are very hard to undo.