Skip to content

Instantly share code, notes, and snippets.

@kana
Created November 13, 2010 08:22
Show Gist options
  • Save kana/675185 to your computer and use it in GitHub Desktop.
Save kana/675185 to your computer and use it in GitHub Desktop.
if(location.href.indexOf('file')==0){var a=document.title,b='setInterval(function(){var c=arguments.callee,a=new XMLHttpRequest;a.open("GET","'+prompt('Trigger file',location.href)+'",true);a.onload=function(){c.a&&a.responseText!=c.a&&window.doc.location.reload(true);c.a=a.responseText};a.send(null)},1E3);';document.write('<script type="text/javascript">'+b+'<\/script><frameset><frame name="doc" src="'+location.href+'"></frame></frameset>');document.close();document.title=a}else alert('This is not a local file.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment