Hacker News new | ask | show | jobs
by roshanr 6122 days ago
Fixed a missing quote and added void(0) at the end:

  javascript:dl=document.links;for(i=0;i<dl.length;++i){if(dl[i].href.substr(-4)==".pdf"){dl[i].href="http://docs.google.com/gview?embedded=true&url="+dl[i].href;}}void(0);
1 comments

Without the lambda, you run the risk of overwriting dl in the global scope, which could cause another script to misbehave.