A BrowserWar is coming soon to an interweb near you!
The source is available on Github, or there’s my fork of it.
Matt Long, of Sagebit, and I wrote it over the past few days. It will kick crappy browsers right in the face!!!
Fork and tweak to your heart’s content! Please send pull requests if you find any bugs or new features.
It is the first open source project Sagebit has released on our new website.
Soon we’ll release a Ruby on Rails plugin that gives you a neat helper method to set up a browser war in your view templates to fight IE, or whatever other browser you have a vendetta against.
Example usage (edit bottom of browserWar.js, or can be called within a script tag in HTML files):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Examples (edit bottom of browserWar.js, or can be called within <script> tag in HTML files):
browserwar.setup();
browserwar.klass('', 'browser_warning', true);
browserwar.message('<p>This site is optimized for the <a href="http://www.mozilla.com/en-US/firefox/"> Mozilla
Firefox</a> browser.</p>' +
"<p>It looks like you're using <b>" + browserwar.browser_display_name + " " + BrowserDetect.version + "</b> or older.
To get the best experience from this site we suggest you upgrade your browser.</p>" +
'<p>Click the image below to learn more about alternative browser options.</p>' +
'<a href="http://browsehappy.com/browsers/" title="Browse Happy: Switch to a safer browser today"><img
src="http://browsehappy.com/buttons/bh_185x75.gif" alt="Browse Happy logo" width="185" height="75"></a>');
browserwar.position('90px','0px','200');
browserwar.linkcolors('blue','red','purple')
browserwar.style('200px','20px','8px ridge #CE8DAD','#fff','#000');
browserwar.fight('Explorer', 6);
browserwar.fight('iCab');
browserwar.run();
|
Sweet! IE will lose the war!
Leave a Comment