Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
449 lines (421 sloc) 16 KB
site:
name: cornify.com
script: http://www.cornify.com/js/rainbow.js
date: 2011-01-26
sniff: |
// Only create rainbow canvas if browser supports the canvas tag.
var rainbowCanvas;
function startRainbow(){
var canvas = document.createElement('canvas');
var isFirefox = (/firefox|minefield/i.test(navigator.userAgent));
//isFirefox = false;
if (!!canvas.getContext && !isFirefox) {
rainbowCanvas = new RainbowCanvas();
rainbowCanvas.init(canvas);
}
}
site:
name: dynamat.com
script: http://dynamat.com/trivantis.js
date: 2011-01-26
sniff: |
function BrowserProps() {
var name = navigator.appName
if (name=="Netscape") name = "ns"
else if (name=="Microsoft Internet Explorer") name = "ie"
this.v = parseInt(navigator.appVersion,10)
this.ns = (name=="ns" && this.v>=4)
this.ns4 = (this.ns && this.v==4)
this.ns5 = (this.ns && this.v==5)
this.nsMac = (this.ns && navigator.platform.indexOf("Mac") >= 0 )
this.ie = (name=="ie" && this.v>=4)
this.ie4 = (this.ie && navigator.appVersion.indexOf('MSIE 4')>0)
this.ie5 = (this.ie && navigator.appVersion.indexOf('MSIE 5')>0)
this.ieMac = (this.ie && navigator.platform.indexOf("Mac") >= 0 )
this.op = navigator.userAgent.indexOf("Opera")!=-1
this.min = (this.ns||this.ie)
this.Mac = (navigator.platform.indexOf("Mac") >= 0)
this.activeX = ( this.ie ) ? true : false;
this.wmpVersion = 6; // default version number we only support 7 and up
var player = null;
try
{
if(window.ActiveXObject)
player = new ActiveXObject("WMPlayer.OCX.7");
else if (window.GeckoActiveXObject)
player = new GeckoActiveXObject("WMPlayer.OCX.7");
else
player = navigator.mimeTypes["application/x-mplayer2"].enabledPlugin;
}
catch(e)
{
// Handle error only if title has wmp-- no WMP control
}
if( player && player.versionInfo ) {
this.wmpVersion = player.versionInfo.slice(0,player.versionInfo.indexOf('.'));
}
}
is = new BrowserProps()
inline: |
if( !is.min )
document.write( 'Your browser does not support dynamic html. Please download a current version of either <a href="http://www.microsoft.com/ie/">Microsoft Internet Explorer</a> or <a href="http://www.mozilla.com/en-US/firefox/">Mozilla Firefox </a> and try visiting our site again. Thank You.<br /><br />' )
site:
name: philosophy.com
script: http://www.philosophy.com/wcsstore/RosettaStore/javascript/BrowserDetect.js
date: 2011-01-26
sniff: |
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i<data.length;i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch || data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
return data[i].identity;
}
else if (dataProp)
return data[i].identity;
}
},
searchVersion: function (dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) return;
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
},
dataBrowser: [
{
string: navigator.userAgent,
subString: "Chrome",
identity: "Chrome"
},
{ string: navigator.userAgent,
subString: "OmniWeb",
versionSearch: "OmniWeb/",
identity: "OmniWeb"
},
{
string: navigator.vendor,
subString: "Apple",
identity: "Safari",
versionSearch: "Version"
},
{
prop: window.opera,
identity: "Opera"
},
{
string: navigator.vendor,
subString: "iCab",
identity: "iCab"
},
{
string: navigator.vendor,
subString: "KDE",
identity: "Konqueror"
},
{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
},
{
string: navigator.vendor,
subString: "Camino",
identity: "Camino"
},
{ // for newer Netscapes (6+)
string: navigator.userAgent,
subString: "Netscape",
identity: "Netscape"
},
{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"
},
{
string: navigator.userAgent,
subString: "Gecko",
identity: "Mozilla",
versionSearch: "rv"
},
{ // for older Netscapes (4-)
string: navigator.userAgent,
subString: "Mozilla",
identity: "Netscape",
versionSearch: "Mozilla"
}
],
dataOS : [
{
string: navigator.userAgent,
subString: "iPhone",
identity: "iPhone"
},
{
string: navigator.userAgent,
subString: "iPad",
identity: "iPad"
},
{
string: navigator.platform,
subString: "Win",
identity: "Windows"
},
{
string: navigator.platform,
subString: "Mac",
identity: "Mac"
},
{
string: navigator.platform,
subString: "Linux",
identity: "Linux"
}
]
};
BrowserDetect.init();
if(BrowserDetect.OS == 'Windows'){
if(BrowserDetect.browser == 'Explorer'){
if(BrowserDetect.version >= 7){
//Browser Supported
document.writeln('<div id="supported_browser" value="true" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else if(BrowserDetect.browser == 'Firefox'){
if(BrowserDetect.version >= 3){
//Browser Supported
document.writeln('<div id="supported_browser" value="true" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else if(BrowserDetect.browser == 'Chrome'){
if(BrowserDetect.version >= 3){
//Browser Supported
document.writeln('<div id="supported_browser" value="flase" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else if(BrowserDetect.OS == 'Mac'){
if(BrowserDetect.browser == 'Safari'){
if(BrowserDetect.version >= 4){
//Browser Supported
document.writeln('<div id="supported_browser" value="true" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else if(BrowserDetect.browser == 'Firefox'){
if(BrowserDetect.version >= 3){
//Browser Supported
document.writeln('<div id="supported_browser" value="true" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else if(BrowserDetect.browser == 'Chrome'){
if(BrowserDetect.version >= 3){
//Browser Supported
document.writeln('<div id="supported_browser" value="true" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
else if((BrowserDetect.OS == 'iPhone') || (BrowserDetect.OS == 'iPad') || (BrowserDetect.OS == 'iPod')){
if(BrowserDetect.browser == 'Safari'){
if(BrowserDetect.version >= 4){
//Browser Supported
document.writeln('<div id="supported_browser" value="true" style="display:none;">\n<\/div>');
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
}
}
else{
//Browser not supported
document.writeln('<div id="supported_browser" value="false" style="display:none;">\n<\/div>');
}
site:
name: github.com
script: https://github.com/404
date: 2011-01-27
sniff: |
// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false;
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE);
site:
name: github.com/keithclark/selectivizr
script: https://github.com/keithclark/selectivizr/blob/cb49ce2ca23d2f61626af3676b6236b61f320f40/selectivizr.js
date: 2011-01-31
sniff: |
var ieVersion = /MSIE ([\d])/.exec(navigator.userAgent)[1];
// If were not in standards mode, IE is too old / new or we can't create
// an XMLHttpRequest object then we should get out now.
if (doc.compatMode != 'CSS1Compat' || ieVersion<6 || ieVersion>8 || !xhr) {
return
}
site:
name: vid.ly
script: http://m.vid.ly/js/html5.js
date: 2011-02-01
sniff: |
hasQiucktime : function () {
ua = navigator.userAgent;
version = parseInt(ua.substr(ua.indexOf('Version')).split(" ").shift().split("/").pop());
return (ua.indexOf('Safari') != -1 && ua.indexOf('iPhone')==-1 && ua.indexOf('iPad') == -1 && ua.indexOf('iPod') == -1 && ua.indexOf("Chrome") == -1 && version < 5);
},
hasVideo : function () {
return (this.hasPlayType() || this.isMobileOSX());
},
isIe : function () {
ua = navigator.userAgent;
return (ua.indexOf('MSIE') != -1 && ua.indexOf('Opera') == -1);
}
site:
name: vid.ly
script: http://vid.ly/templates/js/video.js
date: 2011-02-01
sniff: |
// Browser & Device Checks
VideoJS.isIE = function(){ return !+"\v1"; };
VideoJS.isIPad = function(){ return navigator.userAgent.match(/iPad/i) !== null; };
VideoJS.isIPhone = function(){ return navigator.userAgent.match(/iPhone/i) !== null; };
VideoJS.isIOS = function(){ return VideoJS.isIPhone() || VideoJS.isIPad(); };
VideoJS.iOSVersion = function() {
var match = navigator.userAgent.match(/OS (\d+)_/i);
if (match && match[1]) { return match[1]; }
};
VideoJS.isAndroid = function(){ return navigator.userAgent.match(/Android/i) !== null; };
VideoJS.androidVersion = function() {
var match = navigator.userAgent.match(/Android (\d+)\./i);
if (match && match[1]) { return match[1]; }
};
site:
name: www.assetmanagement.hsbc.com
script: http://www.assetmanagement.hsbc.com/gam/control/js/browser_detect.js
date: 2011-02-02
sniff: |
// JavaScript Document
var browserName=navigator.appName;
if (browserName=="Netscape")
{
}
else
{
if (browserName=="Microsoft Internet Explorer")
{
var browserVer=parseInt(navigator.appVersion);
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null) {
rv = parseFloat( RegExp.$1 );
if(rv == 6) {
document.write('<link href="/gam/control/css/browsers/amg_ie6.css" rel="stylesheet" type="text/css" />');
}
if(rv == 7) {
document.write('<link href="/gam/control/css/browsers/amg_ie7.css" rel="stylesheet" type="text/css" />');
}
/* if(rv == 8) {
document.getElementById("ie").href = "amg_ie8.css";
}*/
}
}
else
{
alert("JS Error");
}
}
site:
name: http://kaazing.me/
script: http://xmpp.kaazing.me/html5/ByteSocket.js
date: 02-07-2011
sniff: |
var browser=null;
if(typeof (ActiveXObject)!="undefined"){
browser="ie";
}else{
if(typeof (window.addEventStream)==="function"){
browser="opera";
}else{
if(navigator.vendor.indexOf("Apple")!=-1){
browser="safari";
}else{
if(navigator.vendor.indexOf("Google")!=-1){
browser="chrome";
}else{
if(navigator.product=="Gecko"&&window.find&&!navigator.savePreferences){
browser="firefox";
}else{
throw new Error("couldn't detect browser");
}
}
}
}
}
site:
name: www.ultimate-guitar.com
script: http://www.ultimate-guitar.com/hostPageScript.js
date: 02-08-2011
sniff: |
// ********** The final criteria for takeover redirect
// ********** this function checks browser and OS version, excluding Mac, up to Win95 and anything other than IE4+
function TakeOverOk() {
var agt=navigator.userAgent.toLowerCase();
var intMajor = parseInt(navigator.appVersion);
var bIE = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var bIE3 = (bIE && (intMajor < 4));
var bIE4 = (bIE && (intMajor == 4) && (agt.indexOf("msie 4")!=-1) );
var bIE4up = (bIE && (intMajor >= 4));
var bWin = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var bWin95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
var bWin31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1));
var b95over = (!(bWin95 || bWin31) && bWin)
var bGTG = (bWin && bIE4up && b95over );
return bGTG
}
#site:
# name:
# script:
# date:
# sniff:
# inline: (optional, if there's inline code calling an embedded script)