\n<\/div>');
271 | }
272 | else{
273 | //Browser not supported
274 | document.writeln('
\n<\/div>');
275 | }
276 | }
277 | }
278 | else{
279 | //Browser not supported
280 | document.writeln('
\n<\/div>');
281 | }
282 |
283 | # @smt let me know that this has been fixed by Github now. See https://github.com/miketaylr/Snort/pull/3#commits-pushed-dd1b8a8
284 | site:
285 | name: github.com
286 | script: https://github.com/404
287 | date: 2011-01-27
288 | sniff: |
289 | // Detect if the browser is IE or not.
290 | // If it is not IE, we assume that the browser is NS.
291 | var IE = document.all?true:false;
292 |
293 | // If NS -- that is, !IE -- then set up for mouse capture
294 | if (!IE) document.captureEvents(Event.MOUSEMOVE);
295 |
296 | site:
297 | name: github.com/keithclark/selectivizr
298 | script: https://github.com/keithclark/selectivizr/blob/cb49ce2ca23d2f61626af3676b6236b61f320f40/selectivizr.js
299 | date: 2011-01-31
300 | sniff: |
301 | var ieVersion = /MSIE ([\d])/.exec(navigator.userAgent)[1];
302 |
303 | // If were not in standards mode, IE is too old / new or we can't create
304 | // an XMLHttpRequest object then we should get out now.
305 | if (doc.compatMode != 'CSS1Compat' || ieVersion<6 || ieVersion>8 || !xhr) {
306 | return
307 | }
308 |
309 | site:
310 | name: vid.ly
311 | script: http://m.vid.ly/js/html5.js
312 | date: 2011-02-01
313 | sniff: |
314 | hasQiucktime : function () {
315 | ua = navigator.userAgent;
316 | version = parseInt(ua.substr(ua.indexOf('Version')).split(" ").shift().split("/").pop());
317 | return (ua.indexOf('Safari') != -1 && ua.indexOf('iPhone')==-1 && ua.indexOf('iPad') == -1 && ua.indexOf('iPod') == -1 && ua.indexOf("Chrome") == -1 && version < 5);
318 | },
319 | hasVideo : function () {
320 | return (this.hasPlayType() || this.isMobileOSX());
321 | },
322 | isIe : function () {
323 | ua = navigator.userAgent;
324 | return (ua.indexOf('MSIE') != -1 && ua.indexOf('Opera') == -1);
325 | }
326 |
327 | site:
328 | name: vid.ly
329 | script: http://vid.ly/templates/js/video.js
330 | date: 2011-02-01
331 | sniff: |
332 | // Browser & Device Checks
333 | VideoJS.isIE = function(){ return !+"\v1"; };
334 | VideoJS.isIPad = function(){ return navigator.userAgent.match(/iPad/i) !== null; };
335 | VideoJS.isIPhone = function(){ return navigator.userAgent.match(/iPhone/i) !== null; };
336 | VideoJS.isIOS = function(){ return VideoJS.isIPhone() || VideoJS.isIPad(); };
337 | VideoJS.iOSVersion = function() {
338 | var match = navigator.userAgent.match(/OS (\d+)_/i);
339 | if (match && match[1]) { return match[1]; }
340 | };
341 | VideoJS.isAndroid = function(){ return navigator.userAgent.match(/Android/i) !== null; };
342 | VideoJS.androidVersion = function() {
343 | var match = navigator.userAgent.match(/Android (\d+)\./i);
344 | if (match && match[1]) { return match[1]; }
345 | };
346 |
347 | site:
348 | name: www.assetmanagement.hsbc.com
349 | script: http://www.assetmanagement.hsbc.com/gam/control/js/browser_detect.js
350 | date: 2011-02-02
351 | sniff: |
352 | // JavaScript Document
353 | var browserName=navigator.appName;
354 | if (browserName=="Netscape")
355 | {
356 |
357 | }
358 | else
359 | {
360 | if (browserName=="Microsoft Internet Explorer")
361 | {
362 |
363 | var browserVer=parseInt(navigator.appVersion);
364 |
365 | var ua = navigator.userAgent;
366 | var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
367 | if (re.exec(ua) != null) {
368 | rv = parseFloat( RegExp.$1 );
369 |
370 | if(rv == 6) {
371 | document.write('');
372 | }
373 | if(rv == 7) {
374 | document.write('');
375 | }
376 | /* if(rv == 8) {
377 | document.getElementById("ie").href = "amg_ie8.css";
378 | }*/
379 |
380 | }
381 | }
382 | else
383 | {
384 | alert("JS Error");
385 | }
386 | }
387 |
388 | site:
389 | name: http://kaazing.me/
390 | script: http://xmpp.kaazing.me/html5/ByteSocket.js
391 | date: 02-07-2011
392 | sniff: |
393 | var browser=null;
394 | if(typeof (ActiveXObject)!="undefined"){
395 | browser="ie";
396 | }else{
397 | if(typeof (window.addEventStream)==="function"){
398 | browser="opera";
399 | }else{
400 | if(navigator.vendor.indexOf("Apple")!=-1){
401 | browser="safari";
402 | }else{
403 | if(navigator.vendor.indexOf("Google")!=-1){
404 | browser="chrome";
405 | }else{
406 | if(navigator.product=="Gecko"&&window.find&&!navigator.savePreferences){
407 | browser="firefox";
408 | }else{
409 | throw new Error("couldn't detect browser");
410 | }
411 | }
412 | }
413 | }
414 | }
415 |
416 | site:
417 | name: www.ultimate-guitar.com
418 | script: http://www.ultimate-guitar.com/hostPageScript.js
419 | date: 02-08-2011
420 | sniff: |
421 | // ********** The final criteria for takeover redirect
422 | // ********** this function checks browser and OS version, excluding Mac, up to Win95 and anything other than IE4+
423 |
424 | function TakeOverOk() {
425 | var agt=navigator.userAgent.toLowerCase();
426 | var intMajor = parseInt(navigator.appVersion);
427 |
428 | var bIE = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
429 | var bIE3 = (bIE && (intMajor < 4));
430 | var bIE4 = (bIE && (intMajor == 4) && (agt.indexOf("msie 4")!=-1) );
431 | var bIE4up = (bIE && (intMajor >= 4));
432 | var bWin = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
433 | var bWin95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
434 | var bWin31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
435 | (agt.indexOf("windows 16-bit")!=-1));
436 | var b95over = (!(bWin95 || bWin31) && bWin)
437 |
438 | var bGTG = (bWin && bIE4up && b95over );
439 |
440 | return bGTG
441 |
442 | }
443 |
444 | site:
445 | name: www.copaair.com
446 | script: http://www.copaair.com/_layouts/1033/init.js?rev=yOq8IoAABYCtaZjMVrjxtg%3D%3D
447 | date: 03-02-2011
448 | sniff: |
449 | function Browseris () {
450 | var agt=navigator.userAgent.toLowerCase();
451 | this.osver=1.0;
452 | if (agt)
453 | {
454 | var stOSVer=agt.substring(agt.indexOf("windows ")+11);
455 | this.osver=parseFloat(stOSVer);
456 | }
457 | this.major=parseInt(navigator.appVersion);
458 | this.nav=((agt.indexOf('mozilla')!=-1)&&((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1)));
459 | this.nav6=this.nav && (this.major==5);
460 | this.nav6up=this.nav && (this.major >=5);
461 | this.nav7up=false;
462 | if (this.nav6up)
463 | {
464 | var navIdx=agt.indexOf("netscape/");
465 | if (navIdx >=0 )
466 | this.nav7up=parseInt(agt.substring(navIdx+9)) >=7;
467 | }
468 | this.ie=(agt.indexOf("msie")!=-1);
469 | this.aol=this.ie && agt.indexOf(" aol ")!=-1;
470 | if (this.ie)
471 | {
472 | var stIEVer=agt.substring(agt.indexOf("msie ")+5);
473 | this.iever=parseInt(stIEVer);
474 | this.verIEFull=parseFloat(stIEVer);
475 | }
476 | else
477 | this.iever=0;
478 | this.ie4up=this.ie && (this.major >=4);
479 | this.ie5up=this.ie && (this.iever >=5);
480 | this.ie55up=this.ie && (this.verIEFull >=5.5);
481 | this.ie6up=this.ie && (this.iever >=6);
482 | this.winnt=((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1));
483 | this.win32=((this.major >=4) && (navigator.platform=="Win32")) ||
484 | (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1);
485 | this.mac=(agt.indexOf("mac")!=-1);
486 | this.w3c=this.nav6up;
487 | this.safari=(agt.indexOf("safari")!=-1);
488 | this.safari125up=false;
489 | if (this.safari && this.major >=5)
490 | {
491 | var navIdx=agt.indexOf("safari/");
492 | if (navIdx >=0)
493 | this.safari125up=parseInt(agt.substring(navIdx+7)) >=125;
494 | }
495 | }
496 | var browseris=new Browseris();
497 | var bis=browseris;
498 |
499 | site:
500 | name: http://www.whatbrowser.org/
501 | script: http://www.whatbrowser.org/en/browser.js
502 | date: 03-07-2011
503 | sniff: |
504 | var browser = {
505 | set: {
506 |
507 | "google_chrome": {
508 | name: "Google Chrome",
509 | match: /Chrome\/(1?[0-9])?\..*? Safari/,
510 | instruction: "google_chrome",
511 | releases: {
512 | "1": {date: "released September 2008 ", version: "1", notes: ''},
513 | "2": {date: "released May 2009 ", version: "2", notes: ''},
514 | "3": {date: "released September 2009 ", version: "3", notes: ''},
515 | "4": {date: "released January 2010 ", version: "4", notes: ''},
516 | "6": {date: "released May 2010 ", version: "6", notes: ''},
517 | "5": {date: "released May 2010 ", version: "5", notes: ''},
518 | "6": {date: "released September 2010 ", version: "6", notes: ''},
519 | "6": {date: "released September 2010 ", version: "6", notes: ''},
520 | "7": {date: "released September 2010 ", version: "7", notes: ''},
521 | "8": {date: "released October 2010 ", version: "8", notes: ''},
522 | "9": {date: "released October 2010 ", version: "9", notes: ''},
523 | "11": {date: "released February 2011 ", version: "11", notes: ''},
524 | "10": {date: "released January 2011 ", version: "10", notes: ''},
525 | "12": {date: "released March 2011 ", version: "12", notes: ''},
526 | "13": {date: "released April 2011 ", version: "13", notes: ''}
527 | }
528 | },
529 |
530 | "internet_explorer_8": {
531 | name: "Internet Explorer",
532 | match: /MSIE ([8])\..*;|MSIE ([7])\.[0-9.]*;.*Trident.*/,
533 | instruction: "internet_explorer_8",
534 | releases: {
535 | "8": {date: "released March 2009 ", version: "8", notes: ''},
536 | "9": {date: "released November 2010 ", version: "9", notes: ''}
537 | }
538 | },
539 |
540 | "internet_explorer_7": {
541 | name: "Internet Explorer",
542 | match: /MSIE ([7])\..*;/,
543 | instruction: "internet_explorer_7",
544 | releases: {
545 | "7": {date: "released October 2006 ", version: "7", notes: ''}
546 | }
547 | },
548 |
549 | "internet_explorer_legacy": {
550 | name: "Internet Explorer",
551 | match: /MSIE ([0-6])\..*;/,
552 | instruction: "internet_explorer_legacy",
553 | releases: {
554 | "6": {date: "released August 2001 ", version: "6", notes: ''},
555 | "5": {date: "released March 1999 ", version: "5", notes: ''}
556 | }
557 | },
558 |
559 | "firefox": {
560 | name: "Firefox",
561 | match: /Firefox\/([1-9](?:\.[0-9])?).*/,
562 | instruction: "firefox",
563 | releases: {
564 | "1": {date: "released November 2004 ", version: "1", notes: ''},
565 | "2": {date: "released October 2006 ", version: "2", notes: ''},
566 | "3": {date: "released June 2008 ", version: "3", notes: ''},
567 | "3.5": {date: "released July 2009 ", version: "3.5", notes: ''},
568 | "3.6": {date: "released January 2010 ", version: "3.6", notes: ''},
569 | "4.0": {date: "released January 2011 ", version: "4", notes: ''}
570 | }
571 | },
572 |
573 | "opera_legacy": {
574 | name: "Opera",
575 | match: /Opera\/([0-8][0-9]?)\..*?|Opera\/([0-9])\.[0-7].*?/,
576 | instruction: "opera_legacy",
577 | releases: {
578 | "9": {date: "released June 2006 ", version: "9", notes: ''},
579 | "7": {date: "released January 2003 ", version: "7", notes: ''},
580 | "6": {date: "released December 2001 ", version: "6", notes: ''},
581 | "8": {date: "released April 2005 ", version: "8", notes: ''},
582 | "9.51": {date: "", version: "9.51", notes: ''},
583 | "9.52": {date: "", version: "9.52", notes: ''},
584 | "9.60": {date: "", version: "9.6", notes: ''},
585 | "9.80": {date: "", version: "9.80", notes: ''}
586 | }
587 | },
588 |
589 | "safari": {
590 | name: "Safari",
591 | match: /Version\/([0-9])\..*? Safari/,
592 | instruction: "safari",
593 | releases: {
594 | "3": {date: "released June 2007 ", version: "3", notes: ''},
595 | "4": {date: "released June 2009 ", version: "4", notes: ''},
596 | "5": {date: "released June 2010 ", version: "5", notes: ''}
597 | }
598 | },
599 |
600 | "safari_legacy": {
601 | name: "Safari",
602 | match: /Safari\/([34]1)/,
603 | instruction: "safari_legacy",
604 | releases: {
605 | "41": {date: "released April 2005 ", version: "2", notes: ''},
606 | "31": {date: "released June 2003 ", version: "1", notes: ''}
607 | }
608 | },
609 |
610 | "opera": {
611 | name: "Opera",
612 | match: /Opera\/[0-9]{1,2}\..*?Version\/([0-9]{1,2}\.[0-9]{1,2}).*?/,
613 | instruction: "opera",
614 | releases: {
615 | "10.51": {date: "released March 2010 ", version: "10.51", notes: ''},
616 | "10.10": {date: "released November 2009 ", version: "10.10", notes: ''},
617 | "10.60": {date: "released June 2010 ", version: "10.6", notes: ''},
618 | "10.52": {date: "released April 2010 ", version: "10.52", notes: ''},
619 | "10.00": {date: "released September 2009 ", version: "10.00", notes: ''},
620 | "10.50": {date: "released March 2010 ", version: "10.50", notes: ''},
621 | "10.53": {date: "released April 2010 ", version: "10.53", notes: ''},
622 | "10.60": {date: "released June 2010 ", version: "10.6", notes: ''},
623 | "10.63": {date: "released October 2010 ", version: "10.63", notes: ''},
624 | "11": {date: "released October 2010 ", version: "11", notes: ''},
625 | "9.52": {date: "", version: "9.52", notes: ''},
626 | "9.8": {date: "", version: "9.8", notes: ''},
627 | "9.51": {date: "", version: "9.51", notes: ''},
628 | "9.60": {date: "", version: "9.60", notes: ''},
629 | "11.01": {date: "released January 2011 ", version: "11", notes: ''}
630 | }
631 | }
632 |
633 | },
634 |
635 | platform: navigator.userAgent.match(/Macintosh/) ? 'Mac' : 'PC',
636 | possibilities: [
637 | 'google_chrome',
638 | 'internet_explorer_8',
639 | 'internet_explorer_7',
640 | 'internet_explorer_legacy',
641 | 'firefox',
642 | 'opera_legacy',
643 | 'safari',
644 | 'safari_legacy',
645 | 'opera'
646 | ],
647 |
648 | detect: function() {
649 | var len = this.possibilities.length;
650 | for (i = 0; i < len; i++) {
651 | var k = this.possibilities[i];
652 | if (this.set.hasOwnProperty(k) && (this.set[k].version = navigator.userAgent.match(this.set[k].match))) {
653 | var matching = this.set[k];
654 |
655 | // hack for ie8 ACTING LIKE ie7
656 | if (k == 'internet_explorer_8' && !matching.version[1]) {
657 | matching.version[1] = '8';
658 | }
659 | if (!matching.releases[matching.version[1]]){
660 | return null;
661 | }
662 | release = matching.releases[matching.version[1]];
663 | matching.version = ['', release.version];
664 | matching.releaseDate = release.date;
665 | matching.notes = release.notes;
666 |
667 | return matching;
668 | }
669 | }
670 | return null;
671 | },
672 |
673 | error_message: function(){
674 | if ('None'!='None'){
675 | return 'None';
676 | } else if ('None'!='None') {
677 | return 'None';
678 | } else{
679 | return "Sorry, we couldn't recognize your browser. The What Browser team has been notified.";
680 | };
681 | }
682 | };
683 |
684 | site:
685 | name: www.3dcontentcentral.com
686 | script: http://www.3dcontentcentral.com/js/base.js
687 | date: 03-09-2011
688 | sniff: |
689 | /*Detect of current browser like server's method*/
690 | eBrowserType={
691 | Chrome_v1:'Chrome_v1',
692 | Chrome_v2:'Chrome_v2',
693 | FF_v2:'FF_v2',
694 | FF_v3:'FF_v3',
695 | IE_v6:'IE_v6',
696 | IE_v7:'IE_v7',
697 | IE_v8:'IE_v8',
698 | Other:'Other'
699 | }
700 | function GetBrowserType()
701 | {
702 | var ua=navigator.userAgent.toUpperCase();
703 |
704 | if (ua.indexOf("CHROME/1.") > -1) return eBrowserType.Chrome_v1;
705 | if (ua.indexOf("CHROME/2.") > -1) return eBrowserType.Chrome_v2;
706 | if (ua.indexOf("FIREFOX/2.")>-1) return eBrowserType.FF_v2;
707 | if (ua.indexOf("FIREFOX/3.")>-1) return eBrowserType.FF_v3;
708 | if (ua.indexOf("MSIE 6.")>-1) return eBrowserType.IE_v6;
709 | if (ua.indexOf("MSIE 7.")>-1) return eBrowserType.IE_v7;
710 | if (ua.indexOf("MSIE 8.")>-1) return eBrowserType.IE_v8;
711 | return eBrowserType.Other;
712 | }
713 |
714 | site:
715 | name: http://lifestream.icq.com/settings
716 | script: http://c.icq.com/js/header_c.js
717 | date: 04-19-2011
718 | sniff: |
719 | // Browser Detection
720 | var detect = navigator.userAgent.toLowerCase();
721 | var gl_os,gl_browser,gl_version,gl_total,thestring;
722 |
723 | if (checkIt('konqueror'))
724 | {
725 | gl_browser = "Konqueror";
726 | gl_os = "Linux";
727 | }
728 | else if (checkIt('safari')) gl_browser = "Safari"
729 | else if (checkIt('omniweb')) gl_browser = "OmniWeb"
730 | else if (checkIt('opera')) gl_browser = "Opera"
731 | else if (checkIt('webtv')) gl_browser = "WebTV";
732 | else if (checkIt('icab')) gl_browser = "iCab"
733 | else if (checkIt('msie')) gl_browser = "Internet Explorer"
734 | else if (!checkIt('compatible'))
735 | {
736 | gl_browser = "Netscape Navigator"
737 | gl_version = detect.charAt(8);
738 | }
739 | else gl_browser = "An unknown browser";
740 |
741 | if (!gl_version) gl_version = detect.charAt(place + thestring.length);
742 |
743 | if (!gl_os)
744 | {
745 | if (checkIt('linux')) gl_os = "Linux";
746 | else if (checkIt('x11')) gl_os = "Unix";
747 | else if (checkIt('mac')) gl_os = "Mac"
748 | else if (checkIt('win')) gl_os = "Windows"
749 | else os = "an unknown operating system";
750 | }
751 |
752 | function checkIt(string)
753 | {
754 | place = detect.indexOf(string) + 1;
755 | thestring = string;
756 | return place;
757 | }
758 | // End Browser Detection.
759 |
760 | site:
761 | name: http://sapid.sourceforge.net/ssetest/
762 | script: (inline)
763 | date: 04-20-2011
764 | sniff: |
765 | /**
766 | * Detects which sort of SSE support to apply if to apply it at all
767 | * @return user agent type
768 | */
769 | var detectUAgent = function() {
770 | if (navigator.appName == "Opera" && -1 !== navigator.appVersion.indexOf("9.")) {
771 | log("Opera browser detected. " + INIT_MESSAGE);
772 | return 'opera';
773 | } else
774 | if (-1 !== navigator.appVersion.indexOf("AppleWebKit/5")) {
775 | log("Apparently, your browser supports SSE. " + INIT_MESSAGE);
776 | return 'webkit';
777 | } else
778 | if (navigator.appName == "Netscape" && -1 !== navigator.appVersion.indexOf("5.0")) {
779 | log("Your browser does not support SSE yet natively, but you can see here emulation. " + INIT_MESSAGE);
780 | return 'webkit';
781 | } else
782 | if (undefined !== window['EventSource']) {
783 | log("I'm not sure about your browser, but let's try. " + INIT_MESSAGE);
784 | return 'webkit';
785 | } else {
786 | log(FAIL_MESSAGE);
787 | return false;
788 | }
789 | };
790 |
791 | site:
792 | name: USPS
793 | script: https://sss-web.usps.com/cns/jscript/windows.js
794 | date: 08-12-2011
795 | sniff: |
796 | // ----------------------------------------------------------------------------------------------------------------------------------------
797 | // This section contains miscellaneous browser related routines and variables.
798 | // You DON'T need to make any changes to this file.
799 | // ----------------------------------------------------------------------------------------------------------------------------------------
800 |
801 | var browserName = "";
802 | var browserVersion = "";
803 | var browserWidth = 0;
804 | var browserHeight = 0;
805 | var browserSupported = true;
806 |
807 | detectBrowser ();
808 | detectBrowserSize ();
809 | testBrowserVersion ();
810 |
811 | // ----------------------------------------------------------------------------------------------------------------------------------------
812 | // detects browser name and version
813 | // ----------------------------------------------------------------------------------------------------------------------------------------
814 |
815 | function detectBrowser ()
816 | {
817 | browserName = navigator.appName;
818 |
819 | if (navigator.userAgent.indexOf ("Opera") > -1)
820 | {
821 | browserName = "Opera";
822 | var index = navigator.userAgent.indexOf ("Opera");
823 | browserVersion = extractBrowserVersion (navigator.userAgent.substring (index + 5));
824 | }
825 |
826 | else if (navigator.userAgent.indexOf ("MSIE") > -1)
827 | {
828 | browserName = "Internet Explorer";
829 | var index = navigator.userAgent.indexOf ("MSIE");
830 | browserVersion = extractBrowserVersion (navigator.userAgent.substring (index + 4));
831 | }
832 |
833 | else if (navigator.vendor == "Netscape6" || navigator.vendor == "Netscape")
834 | {
835 | browserName = "Netscape";
836 | browserVersion = navigator.vendorSub;
837 | }
838 |
839 | else if (navigator.userAgent.indexOf ("Gecko") > -1)
840 | {
841 | browserName = "Mozilla";
842 | var index = navigator.userAgent.indexOf ("rv:");
843 | browserVersion = extractBrowserVersion (navigator.userAgent.substring (index + 3));
844 | }
845 |
846 | else if (navigator.appName.indexOf ("Netscape") != -1)
847 | {
848 | browserName = "Netscape";
849 | var index = navigator.appVersion.indexOf (" ");
850 | browserVersion = navigator.appVersion.substring (0, index);
851 | }
852 | }
853 | // ----------------------------------------------------------------------------------------------------------------------------------------
854 | // extracts browser version
855 | // ----------------------------------------------------------------------------------------------------------------------------------------
856 |
857 | function extractBrowserVersion (browserVersion)
858 | {
859 | browserVersion = trim (browserVersion);
860 |
861 | index = browserVersion.indexOf (";");
862 | if (index > -1)
863 | browserVersion = browserVersion.substring (0, index);
864 | else
865 | {
866 | index = browserVersion.indexOf (")");
867 | if (index > -1)
868 | browserVersion = browserVersion.substring (0, index);
869 | else
870 | {
871 | index = browserVersion.indexOf (" ");
872 | if (index > -1)
873 | browserVersion = browserVersion.substring (0, index);
874 | }
875 | }
876 |
877 | return browserVersion;
878 | }
879 |
880 | // ----------------------------------------------------------------------------------------------------------------------------------------
881 | // tests browser name and version
882 | // ----------------------------------------------------------------------------------------------------------------------------------------
883 |
884 | function testBrowserVersion ()
885 | {
886 | if (! ((browserName == "Internet Explorer" && browserVersion >= "4.0") ||
887 | (browserName == "Netscape" && browserVersion >= "4.0") ||
888 | (browserName == "Mozilla" && browserVersion >= "1.0") ||
889 | (browserName == "Opera" && browserVersion >= "5.0")))
890 | {
891 | browserSupported = false;
892 | alert ("Warning, you are using " + browserName + " Version " + browserVersion + "\n"
893 | + "The recommended browsers to view this page are:\n"
894 | + "- Internet Explorer 4.0 or better\n"
895 | + "- Netscape 4.0 or better\n"
896 | );
897 | }
898 | }
899 |
900 | site:
901 | name: jcpenney.com
902 | script: http://www.jcpenney.com/jcp/Javascript/XBase.js?Version=11172010
903 | date: 08-24-2011
904 | sniff: |
905 | function Browser() {
906 | var BrowserName;
907 | var usrAgent;
908 | var pos;
909 |
910 | this.IEBrowser = false;
911 | this.MozBrowser = false;
912 | this.version = null;
913 | this.MACOS = false;
914 | usrAgent = navigator.userAgent;
915 |
916 |
917 | //OSTest
918 | OSName = "Mac";
919 | if ((pos = usrAgent.indexOf(OSName)) >= 0)
920 | {
921 | this.MACOS = true;
922 | }
923 |
924 | BrowserName = "MSIE";
925 | if ((pos = usrAgent.indexOf(BrowserName)) >= 0)
926 | {
927 | this.IEBrowser = true;
928 | this.version = parseFloat(usrAgent.substr(pos + BrowserName.length));
929 | return;
930 | }
931 |
932 | BrowserName = "Netscape6/";
933 | if ((pos = usrAgent.indexOf(BrowserName)) >= 0)
934 | {
935 | this.MozBrowser = true;
936 | this.version = parseFloat(usrAgent.substr(pos + BrowserName.length));
937 | return;
938 | }
939 |
940 | // Treat any other "Gecko" browser as NS 6.1.
941 |
942 | BrowserName = "Gecko";
943 | if ((pos = usrAgent.indexOf(BrowserName)) >= 0)
944 | {
945 | this.MozBrowser = true;
946 | this.version = 6.1;
947 | return;
948 | }
949 |
950 |
951 | }
952 |
953 | site:
954 | name: sheelapps.com
955 | script: http://sheelapps.com/xinha/XinhaCore.js
956 | date: 09-12-2011
957 | sniff: |
958 | Xinha.agt=navigator.userAgent.toLowerCase();
959 | Xinha.is_ie=((Xinha.agt.indexOf("msie")!=-1)&&(Xinha.agt.indexOf("opera")==-1));
960 | Xinha.ie_version=parseFloat(Xinha.agt.substring(Xinha.agt.indexOf("msie")+5));
961 | Xinha.is_opera=(Xinha.agt.indexOf("opera")!=-1);
962 | Xinha.opera_version=navigator.appVersion.substring(0,navigator.appVersion.indexOf(" "))*1;
963 | Xinha.is_khtml=(Xinha.agt.indexOf("khtml")!=-1);
964 | Xinha.is_safari=(Xinha.agt.indexOf("safari")!=-1);
965 | Xinha.is_mac=(Xinha.agt.indexOf("mac")!=-1);
966 | Xinha.is_mac_ie=(Xinha.is_ie&&Xinha.is_mac);
967 | Xinha.is_win_ie=(Xinha.is_ie&&!Xinha.is_mac);
968 | Xinha.is_gecko=(navigator.product=="Gecko"&&!Xinha.is_safari);
969 | Xinha.isRunLocally=document.URL.toLowerCase().search(/^file:/)!=-1;
970 | Xinha.is_designMode=(typeof document.designMode!="undefined"&&!Xinha.is_ie);
971 | Xinha.checkSupportedBrowser=function(){
972 | if(Xinha.is_gecko){
973 | if(navigator.productSub<20021201){
974 | alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported.");
975 | return false;
976 | }
977 | if(navigator.productSub<20030210){
978 | alert("Mozilla < 1.3 Beta is not supported!\nI'll try, though, but it might not work.");
979 | }
980 | }
981 | if(Xinha.is_opera){
982 | alert("Sorry, Opera is not yet supported by Xinha.");
983 | }
984 | return Xinha.is_gecko||(Xinha.is_opera&&Xinha.opera_version>=9.1)||Xinha.ie_version>=5.5;
985 | };
986 | Xinha.isSupportedBrowser=Xinha.checkSupportedBrowser();
987 |
988 | site:
989 | name: pcworld.com
990 | script: http://ftp.pcworld.com/pub/screencams/ascii-matrix.html
991 | date: 09-19-2011
992 | sniff: |
993 | /******* browser detect ******/
994 |
995 | with(navigator) {
996 | Browser=appName;
997 | Version=parseInt(appVersion.charAt(0));
998 | } //document.write(Browser+" "+Version+" : ");
999 |
1000 | site:
1001 | name: globo.com
1002 | script: http://s.glbimg.com/en/hm/media/CACHE/js/31c83fbe47be.js
1003 | date: 01-06-2012
1004 | sniff: |
1005 | var whoami = {
1006 | userAgent: navigator.userAgent.toLowerCase(),
1007 | browserPlatform: navigator.platform.toLowerCase(),
1008 | platform: {
1009 | name: ''
1010 | },
1011 | browser: {
1012 | name: ''
1013 | },
1014 | modules: {
1015 | platform: [],
1016 | browser: []
1017 | },
1018 | type: {
1019 | platform: 'platform',
1020 | browser: 'browser'
1021 | },
1022 | register: function(type, module) {
1023 | this.modules[type].push(module);
1024 | },
1025 | detect: function(collection, property) {
1026 | for (var i = 0; i < collection.length; i++) {
1027 | collection[i].call(this);
1028 | }
1029 | },
1030 | identify: function() {
1031 | this.detect(this.modules.platform, 'platform');
1032 | this.detect(this.modules.browser, 'browser');
1033 | },
1034 | setPlatformName: function(name) {
1035 | this.platform.name = name;
1036 | this.platform[name] = true;
1037 | },
1038 | helpers: {
1039 | platform: {
1040 | identifyFromPlatform: function(pattern, name) {
1041 | var self = whoami;
1042 | return function() {
1043 | if (pattern.test(self.browserPlatform)) {
1044 | self.setPlatformName(name);
1045 | }
1046 | };
1047 | },
1048 | identifyFromUserAgent: function(pattern, name) {
1049 | var self = whoami;
1050 | return function() {
1051 | if (pattern.test(self.userAgent)) {
1052 | self.setPlatformName(name);
1053 | }
1054 | };
1055 | }
1056 | }
1057 | }
1058 | };
1059 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromPlatform(/mac/, 'mac'));
1060 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromPlatform(/linux/, 'linux'));
1061 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromPlatform(/win/, 'windows'));
1062 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromUserAgent(/ipad/, 'ipad'));
1063 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromUserAgent(/android/, 'android'));
1064 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromUserAgent(/iphone/, 'iphone'));
1065 | whoami.register(whoami.type.platform, whoami.helpers.platform.identifyFromUserAgent(/ipod/, 'ipod'));
1066 | var glb = glb || {};
1067 | glb.cookie = {
1068 | create: function(name, value, minutes, domain) {
1069 | if (minutes) {
1070 | var date = new Date();
1071 | date.setTime(date.getTime() + (minutes * 60 * 1000));
1072 | var expires = '; expires=' + date.toGMTString();
1073 | } else {
1074 | var expires = '';
1075 | }
1076 | domain = (domain) ? '; domain=' + domain: '';
1077 | document.cookie = name + '=' + value + expires + '; path=/' + domain;
1078 | },
1079 | read: function(name) {
1080 | var nameEQ = name + '=';
1081 | var ca = document.cookie.split(';');
1082 | for (var i = 0; i < ca.length; i++) {
1083 | var c = ca[i];
1084 | while (c.charAt(0) == ' ') c = c.substring(1, c.length);
1085 | if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
1086 | }
1087 | return null;
1088 | },
1089 | erase: function(name) {
1090 | this.create(name, '', -1);
1091 | }
1092 | }; (function() {
1093 | whoami.identify();
1094 | var platform = whoami.platform.name;
1095 | var isDesktop = (/^(?:mac|windows|linux|ipad)$/).test(platform);
1096 | if (!isDesktop && !glb.cookie.read('original-page')) {
1097 | if ((/^(?:android|iphone|ipod)$/).test(platform)) {
1098 | window.location = 'http://m.globo.com/touchphone/';
1099 | } else {
1100 | window.location = 'http://m.globo.com/standard/';
1101 | }
1102 | }
1103 | })();
1104 |
1105 | site:
1106 | name: http://2010.usopen.org/en_US/scores/stats/day14/1408dss.html
1107 | script: (inline)
1108 | date: 01/06/2012
1109 | sniff: |
1110 | //display old browser message
1111 | function BrowserCheck() {
1112 | var b = navigator.appName;
1113 | if (b=="Netscape") this.b = "ns";
1114 | else if (b=="Microsoft Internet Explorer") this.b = "ie";
1115 | else if (b=="Opera") this.b = "op";
1116 | else this.b = b;
1117 | this.v = parseInt(navigator.appVersion);
1118 | this.ns = (this.b=="ns" && this.v==4);
1119 | this.ns4 = (this.b=="ns" && this.v>=4 && this.v<5);
1120 | this.ns5 = (this.b=="ns" && this.v>=5);
1121 | this.op = (this.b=="op" && this.v>=4);
1122 | this.op5 = (this.b=="op" && this.v>=5);
1123 | this.ie = (this.b=="ie" && this.v>=4);
1124 | this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
1125 | this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
1126 | this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0);
1127 | if (this.ie5) this.v = 5;
1128 | this.min = (this.ns||this.ie);
1129 | }
1130 | is = new BrowserCheck();
1131 | var isNav = false;
1132 | var isDom = false;
1133 | var isIE = false;
1134 | var isOp = false;
1135 | if (is.ns4){ isNav = true; }
1136 | if (is.ie4 || is.ie5 || is.ie6){ isIE = true; }
1137 | if (is.op5){ isOp = true; }
1138 | if (is.ns5){ isDom = true; }
1139 | if (!isIE && !isNav && !isDom){
1140 | document.write("You need a 4.0+ browser");
1141 | }
1142 |
1143 | site:
1144 | name: monami (github)
1145 | script: https://raw.github.com/jamesgpearce/monomi/master/lib/monomi.js
1146 | date: 01-26-2012
1147 | sniff: |
1148 | var detectBrowserType = exports.detectBrowserType = function (options) {
1149 | var opts = merge({
1150 |
1151 | 'order': ['tablet', 'touch', 'mobile', 'desktop'],
1152 | 'default': 'unknown',
1153 |
1154 | 'tablet': {
1155 | 'user-agent': new RegExp('ipad', 'i')
1156 | },
1157 |
1158 | 'touch': {
1159 | 'user-agent': new RegExp('iphone|android', 'i')
1160 | },
1161 |
1162 | 'mobile': {
1163 | 'order':['x-wap-profile', 'profile', 'accept', 'user-agent'],
1164 | 'x-wap-profile': new RegExp('.+'),
1165 | 'profile': new RegExp('.+'),
1166 | 'accept': new RegExp('wap', 'i'),
1167 | 'user-agent': new RegExp('^(' + [
1168 | 'w3c ', 'w3c-', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac',
1169 | 'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'htc_', 'inno',
1170 | 'ipaq', 'ipod', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-', 'lg/u',
1171 | 'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-', 'newt',
1172 | 'noki', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox', 'qwap', 'sage', 'sams',
1173 | 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar', 'sie-', 'siem', 'smal', 'smar',
1174 | 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-', 'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v',
1175 | 'voda', 'wap-', 'wapa', 'wapi', 'wapp', 'wapr', 'webc', 'winw', 'winw', 'xda ', 'xda-'
1176 | ].join('|') + ')|(' + [
1177 | 'android', 'hiptop', 'ipod', 'lge vx', 'midp', 'mmp', 'netfront', 'palm', 'psp',
1178 | 'openweb', 'opera mobi', 'opera mini', 'phone', 'smartphone', 'symbian', 'up.browser',
1179 | 'up.link', 'wap', 'windows ce'
1180 | ].join('|') + ')' , 'i')
1181 | },
1182 |
1183 | 'desktop': function () {
1184 | return true;
1185 | }
1186 |
1187 | }, options);
1188 |
1189 |
1190 | return function(request, response, next) {
1191 |
1192 | var userAgent = getHeader(request, 'user-agent'); //oft-used
1193 | var browserType = opts['default'];
1194 |
1195 | for (var t in opts['order']) {
1196 | var type = opts['order'][t];
1197 | var options = opts[type];
1198 | if (options && (
1199 | typeof(options)==='function' && options(request, userAgent))
1200 | ||
1201 | detect(request, userAgent, options)
1202 | ) {
1203 | browserType = type;
1204 | break;
1205 | }
1206 | }
1207 |
1208 | request.monomi = {
1209 | 'browserType' : browserType
1210 | };
1211 |
1212 | next();
1213 |
1214 | }
1215 | }
1216 | function detect(request, userAgent, options) {
1217 |
1218 | var opts = merge({
1219 | 'order':['user-agent']
1220 | }, options);
1221 |
1222 | for (var h in opts['order']) {
1223 | var header = opts['order'][h].toLowerCase();
1224 | if (opts[header]) {
1225 | var value = (header==='user-agent') ? userAgent : getHeader(request, header);
1226 | if (value.match(opts[header])!=null) {
1227 | return true;
1228 | }
1229 | }
1230 | }
1231 |
1232 | return false;
1233 | }
1234 |
1235 |
1236 | var getHeader = exports.getHeader = function(request, header, tryPrefix, defaultValue) {
1237 |
1238 | tryPrefix = typeof(tryPrefix) != 'undefined' ? tryPrefix : 'x-device-';
1239 |
1240 | var value = request.headers[tryPrefix + header];
1241 | if (value) { return value; }
1242 |
1243 | value = request.headers[header];
1244 | if (value) { return value; }
1245 |
1246 | return typeof(defaultValue) != 'undefined' ? defaultValue : '';
1247 | }
1248 |
1249 |
1250 | function merge() {
1251 | var merged = {};
1252 | for (a in arguments) {
1253 | for (f in arguments[a]) {
1254 | merged[f] = arguments[a][f];
1255 | }
1256 | }
1257 | return merged;
1258 | };
1259 |
1260 | site:
1261 | name: Wonderful Pistacio Chrome Birds
1262 | script: http://getcrackin.angrybirds.com/
1263 | date: 01-26-2012
1264 | inline: |
1265 | complete : function () {
1266 | if (!Modernizr.hasEvent("touchmove", window)) { // not mobile
1267 | if (Modernizr.testProp('-webkit-box-shadow')) { // is WebKit
1268 | $("#roadblock").addClass("loading");
1269 | $("head").append('');
1270 | GetCrackin.init();
1271 | } else {
1272 | $("#roadblock").addClass("chrome");
1273 | }
1274 | } else {
1275 | $("#roadblock").addClass("mobile");
1276 | }
1277 | }
1278 | site:
1279 | name: Huntington Online Banking
1280 | script: https://www.huntington.com/scripts/browserCheckOnHome.js
1281 | date: 06-28-2012
1282 | sniff: |
1283 | //Set up variables
1284 | var agent="";
1285 | var appVersion="";
1286 | var AppNum = -1;
1287 | var minor = -1;
1288 | var major = -1;
1289 | var OSplatform = "";
1290 | var browserOkay = false;
1291 |
1292 | //Determine browser name and convert chars to lowercase to make it easier to compare strings later
1293 | var agent=navigator.userAgent.toLowerCase();
1294 | var appVersion = navigator.appVersion.toLowerCase();
1295 |
1296 | //Determine browser version numbers
1297 | minor = parseFloat(appVersion);
1298 | major = parseInt(minor);
1299 |
1300 | // Determine OS
1301 | if((agent.indexOf("windows xp")!=-1) || (agent.indexOf("windows nt 5.1")!=-1)) {
1302 | OSplatform="windowsXP";
1303 | }
1304 | else if((agent.indexOf("windows nt 5.0")!=-1) || (agent.indexOf("windows 2000")!=-1)) {
1305 | OSplatform="windows2000";
1306 | }
1307 | else if((agent.indexOf("winnt")!=-1) || (agent.indexOf("windows nt")!=-1)) {
1308 | OSplatform="windowsNT";
1309 | }
1310 | else if((agent.indexOf("win98")!=-1) || (agent.indexOf("windows 98")!=-1)) {
1311 | OSplatform="windows98";
1312 | }
1313 | else if(agent.indexOf("mac")!=-1) {
1314 | OSplatform = "mac";
1315 | }
1316 | if(appVersion.indexOf('msie') !=-1) { //it's IE
1317 | msiePosition = appVersion.indexOf('msie');
1318 | minor = parseFloat(appVersion.substring(msiePosition+5,appVersion.indexOf(';',msiePosition))); //indexOf('searchValue', 'fromIndex')
1319 | if(minor >= 5 && OSplatform == "mac") { browserOkay = true;}
1320 | else if(minor >= 5.5 && (OSplatform.indexOf('windows') != -1)) //OSplatform is any acceptable version of windows
1321 | {
1322 | browserOkay = true;
1323 | }
1324 | } //end IE
1325 | else if(agent.indexOf('mozilla')!=-1 && agent.indexOf('opera')==-1) { //Yay! Mozilla user!
1326 | browserOkay = true;
1327 | }
1328 | else if(parseFloat(navigator.vendorSub)) { //CHECK FOR NN
1329 | minor = parseFloat(navigator.vendorSub);
1330 | if(minor >= 7)
1331 | {
1332 | browserOkay = true;
1333 | }
1334 | } //END CHECK FOR NN
1335 | else if((agent.indexOf('safari')!=-1) && (OSplatform = "mac")) { //CHECK FOR SAFARI
1336 | browserOkay = true;
1337 | }
1338 | else if(agent.indexOf('aol')!=-1) { //CHECK FOR AOL
1339 | if(minor >= 6 && (OSplatform.indexOf('windows') || OSplatform == "mac")) { //OSplatform is any acceptable version of windows or OSplatform is mac
1340 | browserOkay = true;
1341 | }
1342 | else {
1343 | if(minor >= 7 && (OSplatform.indexOf('windows'))) { //OSplatform is any acceptable version of windows
1344 | browserOkay = true;
1345 | }
1346 | }
1347 | }
1348 |
1349 | function browserCheck() {
1350 |
1351 | //alert("agent is " + agent);
1352 | //alert("is firefox? " + agent.indexOf('firefox'));
1353 | //alert("appVersion is " + appVersion);
1354 | //alert("AppNum is " + AppNum);
1355 | //alert("minor is " + minor);
1356 | //alert("major is " + major);
1357 | //alert("OSplatform is " + OSplatform);
1358 | //alert("browserOkay is " + browserOkay);
1359 |
1360 | //do the browser check only if user is on the home page
1361 | if((location.pathname == "/")
1362 | || (location.pathname =="/index.html")
1363 | || (location.pathname =="/index.htm")
1364 | || (location.pathname =="/indexWithIncludes.html"))
1365 | {
1366 | if (browserOkay != true) {
1367 | location.replace("/home/browserUpgrade.htm");
1368 | }
1369 | }
1370 | }
1371 |
1372 | site:
1373 | name: msnbc
1374 | script: http://www.msnbc.msn.com/id/26315908/vp/40140781#40140781
1375 | date: 07-09-2012
1376 | inline: |
1377 | function UberSniff(sUndefined){
1378 | var ua=navigator.userAgent.toLowerCase();
1379 | this.webtv=(ua.indexOf("webtv")>-1);
1380 | this.ie=(parseFloat(ua.slice(ua.indexOf("msie")+5)));
1381 | this.nn=(this.ie)?(-1):(parseFloat(ua.slice(ua.indexOf("mozilla/")+8)));
1382 | this.mac=(ua.indexOf("mac")>-1);
1383 | this.firefox=(ua.indexOf("firefox")>-1);
1384 | this.safari=(ua.indexOf("safari")>-1);
1385 | if(navigator.MSNBCFlashVer==sUndefined){
1386 | if(this.nn<=0&&this.ie<5){
1387 | navigator.MSNBCFlashVer=6;
1388 | }else{
1389 | if(!this.mac&&this.ie>4){
1390 | var oTestVersion=new tryCatch("oWMPlayer=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.'+s1);return s1;","return 0;");
1391 | navigator.MSNBCFlashVer=-1;
1392 | for(var nCheckVersion=9;nCheckVersion>2;--nCheckVersion){
1393 | if(oTestVersion.trycatchV(nCheckVersion)){
1394 | navigator.MSNBCFlashVer=nCheckVersion;break;
1395 | }
1396 | }
1397 | }else{
1398 | if(navigator.plugins['Shockwave Flash']){
1399 | navigator.MSNBCFlashVer=(parseInt(navigator.plugins['Shockwave Flash'].description.substr(16)));
1400 | }else{
1401 | navigator.MSNBCFlashVer=-1;
1402 | }
1403 | }
1404 | }
1405 | }
1406 | this.flash=navigator.MSNBCFlashVer;if(navigator.MSNBCMPlayer==sUndefined){
1407 | if((this.nn<=0&&this.ie<5)||this.mac){
1408 | navigator.MSNBCMPlayer=true;
1409 | }else{
1410 | if(!this.mac&&this.ie>4){
1411 | var oTestVersion=new tryCatch("oWMPlayer=new ActiveXObject('WMPlayer.OCX');return oWMPlayer.versionInfo;","return 0;");
1412 | if(oTestVersion.trycatch()){
1413 | navigator.MSNBCMPlayer=oTestVersion.trycatch();
1414 | }else{
1415 | for(itest=0;itest<9;++itest){
1416 | oTestVersion=new tryCatch("oWMPlayer=new ActiveXObject('MediaPlayer.MediaPlayer.'+itest);return 1;","return 0;");
1417 | navigator.MSNBCMPlayer=(oTestVersion.trycatch());
1418 | if(navigator.MSNBCMPlayer){
1419 | itest=100;
1420 | }
1421 | }
1422 | }
1423 | }else{
1424 | navigator.MSNBCMPlayer=!!(navigator.mimeTypes&&navigator.mimeTypes["video/x-ms-wm"]&&navigator.mimeTypes["video/x-ms-wm"].enabledPlugin);
1425 | }
1426 | }
1427 | }
1428 | this.mplayer=navigator.MSNBCMPlayer;
1429 | this.screenHeight=top.screen.height;
1430 | this.screenWidth=top.screen.width;
1431 | this.colorDepth=(this.nn>=4)?top.screen.pixelDepth:top.screen.colorDepth;
1432 | }
1433 |
1434 | site:
1435 | name: globo.com
1436 | script: http://s.glbimg.com/en/ho/static/CACHE/js/267143c2f15d.js
1437 | date: 07-09-2012
1438 | sniff: |
1439 | vendor = /webkit/i.test(navigator.appVersion) ? "webkit" :
1440 | /firefox/i.test(navigator.userAgent) ? "Moz"
1441 | : /trident/i.test(navigator.userAgent) ? "ms"
1442 | : "opera" in window ? "O" : "",
1443 | isAndroid = /android/gi.test(navigator.appVersion),
1444 | isIDevice = /iphone|ipad/gi.test(navigator.appVersion),
1445 | isPlaybook = /playbook/gi.test(navigator.appVersion),
1446 | isTouchPad = /hp-tablet/gi.test(navigator.appVersion),
1447 | has3d = "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix,
1448 | hasTouch = "ontouchstart" in window && !isTouchPad,
1449 | hasTransform = vendor + "Transform" in document.documentElement.style,
1450 | hasTransitionEnd = isIDevice || isPlaybook
1451 |
1452 | site:
1453 | name: Apache HTTP Server
1454 | script: https://github.com/apache/httpd/commit/a381ff35fa4d50a5f7b9f64300dfd98859dee8d0
1455 | date: 2012-08-11
1456 | sniff: |
1457 | # Deal with user agents that deliberately violate open standards
1458 | #
1459 |
1460 | BrowserMatch "MSIE 10.0;" bad_DNT
1461 |
1462 |
1463 | RequestHeader unset DNT env=bad_DNT
1464 |
1465 |
1466 | site:
1467 | name: nhk.or.jp
1468 | script: http://www.nhk.or.jp/topmenu/1303_js/20130722/common.js
1469 | date: 09-24-2013
1470 | sniff: |
1471 | //browser
1472 | var g_ua=(function(){
1473 | var o={};
1474 | var ua=navigator.userAgent;
1475 | var apn=navigator.appName;
1476 | var apv=navigator.appVersion;
1477 | o.Win9X = (apv.search(/windows 98/i)>-1);
1478 | o.IE = (apn.search(/internet explorer/i)>-1);
1479 | o.Opera = (ua.search(/opera/i)>-1);
1480 | if(o.Opera)o.IE=false;
1481 | o.Safari = (apv.search(/safari/i)>-1);
1482 | o.iPhone = (apv.search(/iphone/i)>-1);
1483 | o.iPod = (apv.search(/ipod/i)>-1);
1484 | o.iPad = (apv.search(/ipad/i)>-1);
1485 | o.Android = (apv.search(/android/i)>-1);
1486 | o.BlackBerry = (ua.search(/blackberry/i)>-1);
1487 | o.SmartPhone = (ua.search(/webkit/i)>-1&&ua.search(/mobile/i)>-1);
1488 | if(o.iPad)o.SmartPhone=false;
1489 | o.iev=-1;
1490 | if(o.IE){
1491 | var re=new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})');
1492 | if(re.exec(ua)!=null)o.iev=parseFloat(RegExp.$1);
1493 | }
1494 | return o;
1495 | })();
1496 |
1497 | site:
1498 | name: nhk.or.jp/sp/
1499 | script: http://www.nhk.or.jp/common/sp/nol_SmartPhone.js
1500 | date: 09-24-2013
1501 | sniff: |
1502 | function nol_getDeviceType(){
1503 | //戻り値 配列 [0]:smart/tablet/other, [1]:type, [2]:flash, [3]:os, [4]:player
1504 | var ua=navigator.userAgent;
1505 | var r=new Array(5);
1506 | if(ua.search(/iphone/i)>-1){
1507 | r=['smart','iphone',false,'ios'];
1508 | }
1509 | else if(ua.search(/ipod/i)>-1){
1510 | r=['smart','ipod',false,'ios'];
1511 | }
1512 | else if(ua.search(/ipad/i)>-1){
1513 | r=['tablet','ipad',false,'ios'];
1514 | }
1515 | else if(ua.search(/android/i)>-1&&ua.search(/webkit/i)>-1){
1516 | if(ua.search(/mobile/i)>-1){
1517 | r=['smart','androidmobile',false,'android'];
1518 | }
1519 | else{
1520 | r=['tablet','androidtablet',false,'android'];
1521 | }
1522 | }
1523 | else if(ua.search(/webkit/i)>-1&&ua.search(/mobile/i)>-1&&ua.search(/iPad/i)==-1){
1524 | r=['smart','othermobile',false,'other'];
1525 | }
1526 | else if(ua.search(/blackberry/i)>-1&&ua.search(/webkit/i)>-1&&ua.search(/mobile/i)>-1){
1527 | r=['smart','blackberry',false,'ohter'];
1528 | }
1529 | else if(ua.search(/windows phone/i)>-1&&ua.search(/msie/i)>-1){
1530 | r=['other','windowsphone',false,'other'];
1531 | }
1532 | else if(ua.search(/^docomo/i)>-1){
1533 | r=['mobile','imode',false,'other'];
1534 | }
1535 | else if(ua.search(/^kddi/i)>-1||ua.search(/^up\.browser/i)>-1){
1536 | r=['mobile','ezweb',false,'other'];
1537 | }
1538 | else if(ua.search(/^softbank/i)>-1||ua.search(/^vodafone/i)>-1||ua.search(/^mot/i)>-1){
1539 | r=['mobile','sb',false,'other'];
1540 | }
1541 | else{
1542 | r=['other','other',false,'other'];
1543 | }
1544 | r[2]=nol_com.chkFlashVideo();
1545 | r[4]=nol_com.getPlayerDetector();
1546 | return r;
1547 | }
1548 |
1549 | site:
1550 | name: h5.qq.com
1551 | script: http://h5.qq.com/HallEngine.js
1552 | date: 10-24-2013
1553 | sniff: |
1554 | function getUA() {
1555 | var a = navigator.userAgent.toLowerCase();
1556 | if (a == null) {
1557 | return "ie"
1558 | } else {
1559 | if (a.indexOf("chrome") != -1) {
1560 | return "chrome"
1561 | } else {
1562 | if (a.indexOf("opera") != -1) {
1563 | return "opera"
1564 | } else {
1565 | if (a.indexOf("msie") != -1) {
1566 | return "ie"
1567 | } else {
1568 | if (a.indexOf("safari") != -1) {
1569 | return "safari"
1570 | } else {
1571 | if (a.indexOf("firefox") != -1) {
1572 | return "firefox"
1573 | } else {
1574 | if (a.indexOf("gecko") != -1) {
1575 | return "gecko"
1576 | } else {
1577 | return "ie"
1578 | }
1579 | }
1580 | }
1581 | }
1582 | }
1583 | }
1584 | }
1585 | }
1586 |
1587 | site:
1588 | name: band.uol.com.br
1589 | date: 11-19-2013
1590 | script: (inline)
1591 | sniff: |
1592 | var ua = navigator.userAgent;
1593 | var iOS = /iPhone/i.test(ua) || /iPod/i.test(ua) || /Android/i.test(ua) ;
1594 |
1595 | if(iOS){
1596 | //alert(iOS);
1597 | window.location.href='http://www.band.com.br/m/';
1598 | }
1599 | #site:
1600 | # name:
1601 | # script:
1602 | # date:
1603 | # sniff:
1604 | # inline: (optional, if there's inline code calling an embedded script)
1605 |
--------------------------------------------------------------------------------