|
4 | 4 | * @version: 0.1.1 |
5 | 5 | * @author: https://twitter.com/isocroft (@isocroft) |
6 | 6 | * @created: 13/11/2014 |
7 | | - * @updated: 05/06/2020 |
| 7 | + * @updated: 06/19/2020 |
8 | 8 | * @license: MIT |
9 | 9 | * @remarks: with love for the OpenSource Community... |
10 | 10 | * |
@@ -51,9 +51,9 @@ function has_pcredentials_iconurl(){ |
51 | 51 |
|
52 | 52 | function actual_non_emulated_IE_major_version() { |
53 | 53 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. |
54 | | - // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx |
| 54 | + // IE JavaScript conditional compilation ( @cc_on ) |
55 | 55 |
|
56 | | - // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx |
| 56 | + // See: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx |
57 | 57 |
|
58 | 58 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')(); // jshint ignore:line |
59 | 59 |
|
@@ -210,9 +210,9 @@ contentLoaded.apply(null, [window, function(){ |
210 | 210 |
|
211 | 211 | }, |
212 | 212 | isWebOS:function(bd){ |
213 | | - |
214 | | - // @See: http://ryanmorr.com/the-state-of-browser-detection/ |
215 | | - return (('PalmSystem' in w) && (ua.search(/(Web|HPW)OS/) > -1)); |
| 213 | + |
| 214 | + // @See: http://ryanmorr.com/the-state-of-browser-detection/ |
| 215 | + return (('PalmSystem' in w) && (ua.search(/(Web|HPW)OS/) > -1)); |
216 | 216 |
|
217 | 217 | } |
218 | 218 | }, |
@@ -551,28 +551,37 @@ contentLoaded.apply(null, [window, function(){ |
551 | 551 |
|
552 | 552 | } |
553 | 553 |
|
554 | | - w.isSafariAndiOS12OrLater = function(){ |
555 | | - return isSafWebkit && (typeof n.share === 'function' && typeof w['IntersectionObserver'] === 'function') && (); |
| 554 | + var isSafariAndiOS12OrLater = function(){ |
| 555 | + return isSafWebkit && (typeof n.share === 'function' && typeof w['IntersectionObserver'] === 'function') && (String(w.IntersectionObserver) === 'function IntersectionObserver() { [native code] }'); |
556 | 556 | } |
557 | 557 |
|
558 | | - w.isOpera33OrLater = function(){ |
559 | | - return isBlink && !isPresto && (!!w.opr && !!w.opr.addons && typeof w.CSS.supports === 'function') && (String(w.caches) === '[object CacheStorage]'); |
| 558 | + var isOpera33OrLater = function(){ |
| 559 | + return isBlink && !isPresto && ((!!w.opr && !!w.opr.addons) && (!!w.CSS && typeof w.CSS.supports === 'function')) && (String(w.caches) === '[object CacheStorage]'); |
560 | 560 | } |
561 | 561 |
|
562 | | - w.isEdge17OrLater = function(){ |
| 562 | + var isEdge17OrLater = function(){ |
563 | 563 | return (isEdgeChromium || isEdgeHTML) && (typeof w.PushManager === 'function') && (String(w.PushManager) === 'function PushManager() { [native code] }'); |
564 | 564 | } |
565 | 565 |
|
566 | | - w.isChrome40OrLater = function(){ |
| 566 | + var isChrome40OrLater = function(){ |
567 | 567 | var i = d.createElement('input'); |
568 | 568 | return isChrWebkit && isChromiumBlink && (typeof i['reportValidity'] === 'function') && (String(i['reportValidity']) === 'function reportValidity() { [native code] }'); |
569 | 569 | } |
570 | 570 |
|
571 | | - w.isFirefox44OrLater = function(){ |
| 571 | + var isFirefox44OrLater = function(){ |
572 | 572 | return isGecko && (typeof w.PushManager === 'function') && (String(w.PushManager) === 'function PushManager() {\n [native code]\n}'); |
573 | 573 | } |
574 | 574 |
|
575 | | - w.isSamsungInternet4OrLater = function(){ return false; } |
| 575 | + var isSamsungInternet4OrLater = function(){ return false; } |
| 576 | + |
| 577 | + w.navigator.isSWCapable = function() { |
| 578 | + return isSafariAndiOS12OrLater() |
| 579 | + || isOpera33OrLater() |
| 580 | + || isEdge17OrLater() |
| 581 | + || isChrome40OrLater() |
| 582 | + || isFirefox44OrLater() |
| 583 | + || isSamsungInternet4OrLater(); |
| 584 | + }; |
576 | 585 |
|
577 | 586 | /* retrieve browser build name (if any) */ |
578 | 587 |
|
|
0 commit comments