Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Juju on March 04, 2012, 01:11:23 am

Title: FPS Counter
Post by: Juju on March 04, 2012, 01:11:23 am
Paste this into your address bar and/or your bookmark bar and you get a FPS counter on any site. Pretty useful if you lag or if you want to benchmark your browser. (Note that it's the same FPS counter used in OmniPlayer2.)
 
Code: [Select]
javascript:(function(){var script=document.createElement('script');script.type='text/javascript';script.src='http://github.com/mrdoob/stats.js/raw/master/build/Stats.js';document.body.appendChild(script);script=document.createElement('script');script.innerHTML='var interval=setInterval(function(){if(typeof Stats==\'function\'){clearInterval(interval);var stats=new Stats();stats.getDomElement().style.position=\'fixed\';stats.getDomElement().style.left=\'0px\';stats.getDomElement().style.top=\'0px\';document.body.appendChild(stats.getDomElement());setInterval(function(){stats.update();},1000/60);}},100);';document.body.appendChild(script);})();
Title: Re: FPS Counter
Post by: Deep Toaster on March 04, 2012, 01:16:30 am
Nice, did you write it yourself?

(When I saw who started the post, I had to read through the code first to make sure it wasn't a rickroll :P)
Title: Re: FPS Counter
Post by: Juju on March 04, 2012, 04:09:27 am
No, I found this on GitHub.
Title: Re: FPS Counter
Post by: Jonius7 on March 04, 2012, 07:03:57 pm
I'm not really sure how to use this. I can use something like Katamari which used javascript and a bookmark but it just does a google search when I paste it into the address bar.
Title: Re: FPS Counter
Post by: Juju on March 04, 2012, 07:21:40 pm
Hm, for some reason, Google Chrome removes the javascript: at the beginning when you paste it into the address bar, so you have to put it back.
Title: Re: FPS Counter
Post by: Jonius7 on March 06, 2012, 07:55:11 am
Very weird, why no simple copy and paste true code/url!!!
It's like when you copy a link from a Google search result and you have this convoluted google url instead of the actual url.

Anyway about the FPS counter:
Still doesn't work for me. I know I am not doing something right but it should work similar to Katamari, which I bookmarked.