diff --git a/dist/chromium-detector.js b/dist/chromium-detector.js index 36f9add..5cd11ba 100644 --- a/dist/chromium-detector.js +++ b/dist/chromium-detector.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.chromiumDetector=t():e.chromiumDetector=t()}(self,(function(){return(()=>{"use strict";var e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>m,getBrowserInfo:()=>u});const s=e=>"function"==typeof e&&"function"==typeof e.toString&&e.toString().includes("[native code]"),r=e=>"object"==typeof e,a=e=>void 0!==document.createElement("div").style[e],o=(e,t)=>{const s=document.createElement("div");return s.style[e]=t,s.style[e]===t},n=e=>{try{return document.querySelector(e),!0}catch(e){return!1}},c={95:{releaseDate:"Pre-release",isPreRelease:!0,tests:[{url:"https://chromestatus.com/features/6304275594477568",name:"EyeDropper API",test:()=>s(window.EyeDropper)},{url:"https://chromestatus.com/features/5709654999957504",name:"Logical properties for contain-intrinsic-size",test:()=>a("containIntrinsicBlockSize")}]},94:{releaseDate:"Pre-release",isPreRelease:!0,tests:[{url:"https://chromestatus.com/feature/5144822362931200",name:"Feature Policy: display-capture",test:()=>document.createElement("iframe").featurePolicy.allowedFeatures().includes("display-capture")},{url:"https://chromestatus.com/features/5746559209701376",name:"CSS Overflow: scrollbar-gutter",test:()=>a("scrollbarGutter")}]},93:{releaseDate:"2021-08-31",tests:[{url:"https://chromestatus.com/feature/5642501387976704",name:"AbortSignal.abort() static method",test:()=>s(window.AbortSignal.abort)},{url:"https://chromestatus.com/feature/5662263404920832",name:"Object.hasOwn",test:()=>s(Object.hasOwn)},{url:"https://chromestatus.com/feature/5727099325251584",name:"Feature: Error.cause property",test:()=>"testing"===new Error("MyError",{cause:"testing"}).cause},{url:"https://chromestatus.com/feature/5092414224072704",name:"noplaybackrate in HTMLMediaElement.controlsList",test:()=>document.createElement("video").controlsList.supports("noplaybackrate")}]},92:{releaseDate:"2021-07-20",tests:[{url:"https://chromestatus.com/feature/6520669959356416",name:"dayPeriod option for Intl.DateTimeFormat",test:()=>new Intl.DateTimeFormat("en",{hour:"numeric",dayPeriod:"short"}).format(new Date("2019-05-20T07:00:00")).length>4},{url:"https://chromestatus.com/feature/6123640410079232",name:"Relative indexing method for Array, String, and TypedArrays",test:()=>s([].at)}]},91:{releaseDate:"2021-05-21",tests:[{url:"https://chromestatus.com/feature/5692693659254784",name:"CSS custom counter styles",test:()=>{const e=document.createElement("style");e.innerHTML='@counter-style custom { system: fixed; symbols: Ⓐ Ⓑ Ⓒ; suffix: " "; }',document.head.appendChild(e);const t=document.createElement("ul");t.style.listStyle="custom";const s="custom"===t.style.listStyle;return document.head.removeChild(e),s}}]},90:{releaseDate:"2021-04-14",tests:[{url:"https://chromestatus.com/feature/5638444178997248",name:'Add support for CSS properties "overflow: clip" and "overflow-clip-margin"',test:()=>o("overflow","clip")},{url:"https://chromestatus.com/feature/5737185317748736",name:"Support specifying width/height on elements for ",test:()=>void 0!==document.createElement("source").width}]},89:{releaseDate:"2021-03-02",tests:[{url:"https://chromestatus.com/feature/5172464636133376",name:"WebHID support",optional:!0,test:()=>r(window.navigator.hid)},{url:"https://chromestatus.com/feature/6561346332131328",name:"disclosure-open and disclosure-closed keywords for CSS list-style-type property",test:()=>o("listStyleType","disclosure-open")}]},88:{releaseDate:"2021-01-19",tests:[{url:"https://chromestatus.com/feature/5445716612743168",name:"CSS Selectors 4 Pseudo-Classes :is(), :where()",test:()=>n(":where(div)")},{url:"https://chromestatus.com/feature/5738050678161408",name:"CSS aspect-ratio property",test:()=>a("aspectRatio")}]},87:{releaseDate:"2020-11-17",tests:[{url:"https://chromestatus.com/feature/6243382101803008",name:"Atomics.waitAsync",test:()=>s(Atomics.waitAsync)},{url:"https://chromestatus.com/feature/5658847691669504",name:"Cookie Store API",test:()=>r(window.cookieStore)},{url:"https://chromestatus.com/features/5719830432841728",name:"Is-Input-Pending",test:()=>s(window.navigator.scheduling.isInputPending)},{url:"https://chromestatus.com/feature/5747636764147712",name:"text-decoration-thickness",test:()=>a("textDecorationThickness")}]},86:{releaseDate:"2020-10-06",tests:[{url:"https://chromestatus.com/feature/6710566854852608",name:"CSS ::marker pseudo-element",test:()=>n("::marker")},{url:"https://chromestatus.com/feature/5823526732824576",name:"CSS Selectors 4 Pseudo-Class :focus-visible",test:()=>n(":focus-visible")},{url:"https://chromestatus.com/feature/6284708426022912",name:"File System Access",optional:!0,test:()=>s(window.showOpenFilePicker)},{url:"https://chromestatus.com/feature/5742134990733312",name:"HTMLMediaElement.preservesPitch",test:()=>void 0!==document.createElement("video").preservesPitch},{url:"https://chromestatus.com/feature/6143552666992640",name:"ParentNode.replaceChildren() Method",test:()=>s(document.body.replaceChildren)}]},85:{releaseDate:"2020-08-25",tests:[{url:"https://chromestatus.com/feature/4613920211861504",name:"CSS content-visibility property",test:()=>a("contentVisibility")},{url:"https://chromestatus.com/feature/4688138070917120",name:"CSS counter-set",test:()=>a("counterSet")},{url:"https://chromestatus.com/feature/5574922384441344",name:"Promise.any and AggregateError",test:()=>s(Promise.any)},{url:"https://chromestatus.com/feature/6040389083463680",name:"String.prototype.replaceAll",test:()=>s("".replaceAll)}]},84:{releaseDate:"2020-07-14",tests:[{url:"https://chromestatus.com/feature/5892186633666560",name:"JavaScript weak references",test:()=>s(window.WeakRef)},{url:"https://chromestatus.com/feature/4636879949398016",name:"Screen Wake Lock API",test:()=>r(window.navigator.wakeLock)},{url:"https://chromestatus.com/feature/4715298156445696",name:"Unprefixed appearance CSS property",test:()=>a("appearance")},{url:"https://chromestatus.com/feature/6249925820022784",name:"Unprefixed ruby-position CSS property",test:()=>a("rubyPosition")},{url:"https://chromestatus.com/feature/5644990145363968",name:"revert keyword",test:()=>o("display","revert")}]},83:{releaseDate:"2020-05-19",tests:[{url:"https://chromestatus.com/feature/4757990523535360",name:"Barcode Detection API",optional:!0,test:()=>s(window.BarcodeDetector)},{url:"https://chromestatus.com/feature/5913213940006912",name:"auto keyword for -webkit-appearance CSS property CSS",test:()=>o("webkitAppearance","auto")},{url:"https://chromestatus.com/feature/5737051062272000",name:"CSS contain-intrinsic-size",test:()=>a("containIntrinsicSize")},{url:"https://chromestatus.com/feature/6335927192387584",name:"HTMLVideoElement.requestVideoFrameCallback()",test:()=>s(document.createElement("video").requestVideoFrameCallback)}]},81:{releaseDate:"2020-04-07",tests:[{url:"https://chromestatus.com/feature/4965112605573120",name:"Intl.DisplayNames",test:()=>s(window.Intl.DisplayNames)},{url:"https://chromestatus.com/feature/5440098147500032",name:"Streams API: WritableStream close()",test:()=>s((new window.WritableStream).close)},{url:"https://chromestatus.com/feature/6313474512650240",name:"Support for CSS image-orientation property",test:()=>a("imageOrientation")}]},80:{releaseDate:"2020-02-04",tests:[{url:"https://chromestatus.com/feature/5668660729348096",name:"line-break: anywhere",test:()=>o("lineBreak","anywhere")},{url:"https://chromestatus.com/feature/5687791428042752",name:"HTMLVideoElement.getVideoPlaybackQuality()",test:()=>s(document.createElement("video").getVideoPlaybackQuality)},{url:"https://chromestatus.com/feature/5126089347170304",name:"overflow-wrap: anywhere",test:()=>o("overflowWrap","anywhere")}]},79:{releaseDate:"2019-12-10",tests:[{url:"https://chromestatus.com/feature/5714277878988800",name:"CSS min(), max() and clamp()",test:()=>o("height","min(1px, 10px)")},{url:"https://chromestatus.com/feature/5685958032752640",name:"font-optical-sizing",test:()=>a("fontOpticalSizing")}]}},u=()=>{const e=Object.keys(c).sort(((e,t)=>parseInt(e)-parseInt(t))),t=e.reduce(((e,t)=>{const{tests:s,releaseDate:r,isPreRelease:a}=c[t];return e[t]={pass:0,result:!0,tests:[],releaseDate:r,isPreRelease:!0===a},s.forEach((({url:s,name:r,test:a,optional:o})=>{const n={url:s,name:r,optional:!0===o};try{n.test=a()}catch(e){n.test=!1}n.test?e[t].pass++:!0!==o&&(e[t].result=!1),e[t].tests.push(n)})),e}),{}),s=e.find(((s,r)=>{if(r===e.length-1)return!0;switch(t[e[r+1]].result){case!1:return!0;default:return!1}})),r=e.some((e=>0!==t[e].pass&&t[e].pass!==t[e].tests.length&&t[e].pass!==t[e].tests.length-1));return{version:s||"unknown",couldBeOlder:s===e[0],couldBeNewer:s===e[e.length-1],tests:t,isChromium:!r}},m={getBrowserInfo:u};return t})()})); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.chromiumDetector=t():e.chromiumDetector=t()}(self,(function(){return(()=>{"use strict";var e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>m,getBrowserInfo:()=>u});const s=e=>"function"==typeof e&&"function"==typeof e.toString&&e.toString().includes("[native code]"),r=e=>"object"==typeof e,a=e=>void 0!==document.createElement("div").style[e],o=(e,t)=>{const s=document.createElement("div");return s.style[e]=t,s.style[e]===t},n=e=>{try{return document.querySelector(e),!0}catch(e){return!1}},c={97:{releaseDate:"Pre-release",isPreRelease:!0,tests:[{url:"https://chromestatus.com/feature/5693639729610752",name:"Array and TypedArray findLast and findLastIndex",test:()=>s([].findLast)},{url:"https://chromestatus.com/feature/5687325523705856",name:"transform: perspective(none)",test:()=>o("transform","perspective(none)")}]},96:{releaseDate:"Pre-release",isPreRelease:!0,tests:[{url:"https://chromestatus.com/feature/5646323212615680",name:"Media Queries: prefers-contrast feature",test:()=>"prefers-contrast: more"===window.matchMedia("(prefers-contrast: more)").media}]},95:{releaseDate:"2021-10-19",isPreRelease:!0,tests:[{url:"https://chromestatus.com/features/6304275594477568",name:"EyeDropper API",test:()=>s(window.EyeDropper)},{url:"https://chromestatus.com/features/5709654999957504",name:"Logical properties for contain-intrinsic-size",test:()=>a("containIntrinsicBlockSize")}]},94:{releaseDate:"2021-09-21",tests:[{url:"https://chromestatus.com/feature/5144822362931200",name:"Feature Policy: display-capture",test:()=>document.createElement("iframe").featurePolicy.allowedFeatures().includes("display-capture")},{url:"https://chromestatus.com/features/5746559209701376",name:"CSS Overflow: scrollbar-gutter",test:()=>a("scrollbarGutter")}]},93:{releaseDate:"2021-08-31",tests:[{url:"https://chromestatus.com/feature/5642501387976704",name:"AbortSignal.abort() static method",test:()=>s(window.AbortSignal.abort)},{url:"https://chromestatus.com/feature/5662263404920832",name:"Object.hasOwn",test:()=>s(Object.hasOwn)},{url:"https://chromestatus.com/feature/5727099325251584",name:"Feature: Error.cause property",test:()=>"testing"===new Error("MyError",{cause:"testing"}).cause},{url:"https://chromestatus.com/feature/5092414224072704",name:"noplaybackrate in HTMLMediaElement.controlsList",test:()=>document.createElement("video").controlsList.supports("noplaybackrate")}]},92:{releaseDate:"2021-07-20",tests:[{url:"https://chromestatus.com/feature/6520669959356416",name:"dayPeriod option for Intl.DateTimeFormat",test:()=>new Intl.DateTimeFormat("en",{hour:"numeric",dayPeriod:"short"}).format(new Date("2019-05-20T07:00:00")).length>4},{url:"https://chromestatus.com/feature/6123640410079232",name:"Relative indexing method for Array, String, and TypedArrays",test:()=>s([].at)}]},91:{releaseDate:"2021-05-21",tests:[{url:"https://chromestatus.com/feature/5692693659254784",name:"CSS custom counter styles",test:()=>{const e=document.createElement("style");e.innerHTML='@counter-style custom { system: fixed; symbols: Ⓐ Ⓑ Ⓒ; suffix: " "; }',document.head.appendChild(e);const t=document.createElement("ul");t.style.listStyle="custom";const s="custom"===t.style.listStyle;return document.head.removeChild(e),s}}]},90:{releaseDate:"2021-04-14",tests:[{url:"https://chromestatus.com/feature/5638444178997248",name:'Add support for CSS properties "overflow: clip" and "overflow-clip-margin"',test:()=>o("overflow","clip")},{url:"https://chromestatus.com/feature/5737185317748736",name:"Support specifying width/height on elements for ",test:()=>void 0!==document.createElement("source").width}]},89:{releaseDate:"2021-03-02",tests:[{url:"https://chromestatus.com/feature/5172464636133376",name:"WebHID support",optional:!0,test:()=>r(window.navigator.hid)},{url:"https://chromestatus.com/feature/6561346332131328",name:"disclosure-open and disclosure-closed keywords for CSS list-style-type property",test:()=>o("listStyleType","disclosure-open")}]},88:{releaseDate:"2021-01-19",tests:[{url:"https://chromestatus.com/feature/5445716612743168",name:"CSS Selectors 4 Pseudo-Classes :is(), :where()",test:()=>n(":where(div)")},{url:"https://chromestatus.com/feature/5738050678161408",name:"CSS aspect-ratio property",test:()=>a("aspectRatio")}]},87:{releaseDate:"2020-11-17",tests:[{url:"https://chromestatus.com/feature/6243382101803008",name:"Atomics.waitAsync",test:()=>s(Atomics.waitAsync)},{url:"https://chromestatus.com/feature/5658847691669504",name:"Cookie Store API",test:()=>r(window.cookieStore)},{url:"https://chromestatus.com/features/5719830432841728",name:"Is-Input-Pending",test:()=>s(window.navigator.scheduling.isInputPending)},{url:"https://chromestatus.com/feature/5747636764147712",name:"text-decoration-thickness",test:()=>a("textDecorationThickness")}]},86:{releaseDate:"2020-10-06",tests:[{url:"https://chromestatus.com/feature/6710566854852608",name:"CSS ::marker pseudo-element",test:()=>n("::marker")},{url:"https://chromestatus.com/feature/5823526732824576",name:"CSS Selectors 4 Pseudo-Class :focus-visible",test:()=>n(":focus-visible")},{url:"https://chromestatus.com/feature/6284708426022912",name:"File System Access",optional:!0,test:()=>s(window.showOpenFilePicker)},{url:"https://chromestatus.com/feature/5742134990733312",name:"HTMLMediaElement.preservesPitch",test:()=>void 0!==document.createElement("video").preservesPitch},{url:"https://chromestatus.com/feature/6143552666992640",name:"ParentNode.replaceChildren() Method",test:()=>s(document.body.replaceChildren)}]},85:{releaseDate:"2020-08-25",tests:[{url:"https://chromestatus.com/feature/4613920211861504",name:"CSS content-visibility property",test:()=>a("contentVisibility")},{url:"https://chromestatus.com/feature/4688138070917120",name:"CSS counter-set",test:()=>a("counterSet")},{url:"https://chromestatus.com/feature/5574922384441344",name:"Promise.any and AggregateError",test:()=>s(Promise.any)},{url:"https://chromestatus.com/feature/6040389083463680",name:"String.prototype.replaceAll",test:()=>s("".replaceAll)}]},84:{releaseDate:"2020-07-14",tests:[{url:"https://chromestatus.com/feature/5892186633666560",name:"JavaScript weak references",test:()=>s(window.WeakRef)},{url:"https://chromestatus.com/feature/4636879949398016",name:"Screen Wake Lock API",test:()=>r(window.navigator.wakeLock)},{url:"https://chromestatus.com/feature/4715298156445696",name:"Unprefixed appearance CSS property",test:()=>a("appearance")},{url:"https://chromestatus.com/feature/6249925820022784",name:"Unprefixed ruby-position CSS property",test:()=>a("rubyPosition")},{url:"https://chromestatus.com/feature/5644990145363968",name:"revert keyword",test:()=>o("display","revert")}]},83:{releaseDate:"2020-05-19",tests:[{url:"https://chromestatus.com/feature/4757990523535360",name:"Barcode Detection API",optional:!0,test:()=>s(window.BarcodeDetector)},{url:"https://chromestatus.com/feature/5913213940006912",name:"auto keyword for -webkit-appearance CSS property CSS",test:()=>o("webkitAppearance","auto")},{url:"https://chromestatus.com/feature/5737051062272000",name:"CSS contain-intrinsic-size",test:()=>a("containIntrinsicSize")},{url:"https://chromestatus.com/feature/6335927192387584",name:"HTMLVideoElement.requestVideoFrameCallback()",test:()=>s(document.createElement("video").requestVideoFrameCallback)}]},81:{releaseDate:"2020-04-07",tests:[{url:"https://chromestatus.com/feature/4965112605573120",name:"Intl.DisplayNames",test:()=>s(window.Intl.DisplayNames)},{url:"https://chromestatus.com/feature/5440098147500032",name:"Streams API: WritableStream close()",test:()=>s((new window.WritableStream).close)},{url:"https://chromestatus.com/feature/6313474512650240",name:"Support for CSS image-orientation property",test:()=>a("imageOrientation")}]},80:{releaseDate:"2020-02-04",tests:[{url:"https://chromestatus.com/feature/5668660729348096",name:"line-break: anywhere",test:()=>o("lineBreak","anywhere")},{url:"https://chromestatus.com/feature/5687791428042752",name:"HTMLVideoElement.getVideoPlaybackQuality()",test:()=>s(document.createElement("video").getVideoPlaybackQuality)},{url:"https://chromestatus.com/feature/5126089347170304",name:"overflow-wrap: anywhere",test:()=>o("overflowWrap","anywhere")}]},79:{releaseDate:"2019-12-10",tests:[{url:"https://chromestatus.com/feature/5714277878988800",name:"CSS min(), max() and clamp()",test:()=>o("height","min(1px, 10px)")},{url:"https://chromestatus.com/feature/5685958032752640",name:"font-optical-sizing",test:()=>a("fontOpticalSizing")}]}},u=()=>{const e=Object.keys(c).sort(((e,t)=>parseInt(e)-parseInt(t))),t=e.reduce(((e,t)=>{const{tests:s,releaseDate:r,isPreRelease:a}=c[t];return e[t]={pass:0,result:!0,tests:[],releaseDate:r,isPreRelease:!0===a},s.forEach((({url:s,name:r,test:a,optional:o})=>{const n={url:s,name:r,optional:!0===o};try{n.test=a()}catch(e){n.test=!1}n.test?e[t].pass++:!0!==o&&(e[t].result=!1),e[t].tests.push(n)})),e}),{}),s=e.find(((s,r)=>{if(r===e.length-1)return!0;switch(t[e[r+1]].result){case!1:return!0;default:return!1}})),r=e.some((e=>0!==t[e].pass&&t[e].pass!==t[e].tests.length&&t[e].pass!==t[e].tests.length-1));return{version:s||"unknown",couldBeOlder:s===e[0],couldBeNewer:s===e[e.length-1],tests:t,isChromium:!r}},m={getBrowserInfo:u};return t})()})); \ No newline at end of file diff --git a/index.js b/index.js index e5fab06..ebef255 100644 --- a/index.js +++ b/index.js @@ -48,9 +48,36 @@ const supportsCSSQuery = (query) => { // https://chromestatus.com/features const descriptors = { - 95: { + 97: { + releaseDate: 'Pre-release', + isPreRelease: true, + tests: [ + { + url: 'https://chromestatus.com/feature/5693639729610752', + name: 'Array and TypedArray findLast and findLastIndex', + test: () => isFunction([].findLast) + }, + { + url: 'https://chromestatus.com/feature/5687325523705856', + name: 'transform: perspective(none)', + test: () => supportsCSSValue('transform', 'perspective(none)') + } + ] + }, + 96: { releaseDate: 'Pre-release', isPreRelease: true, + tests: [ + { + url: 'https://chromestatus.com/feature/5646323212615680', + name: 'Media Queries: prefers-contrast feature', + test: () => window.matchMedia('(prefers-contrast: more)').media === 'prefers-contrast: more' + } + ] + }, + 95: { + releaseDate: '2021-10-19', + isPreRelease: true, tests: [ { url: 'https://chromestatus.com/features/6304275594477568', @@ -65,8 +92,7 @@ const descriptors = { ] }, 94: { - releaseDate: 'Pre-release', - isPreRelease: true, + releaseDate: '2021-09-21', tests: [ { url: 'https://chromestatus.com/feature/5144822362931200', diff --git a/package.json b/package.json index 4e535b6..b8de882 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chromium-detector", - "version": "1.0.12", + "version": "1.0.14", "description": "Feature detects the running version of Chromium without any UserAgent parsing", "main": "dist/chromium-detector.js", "module": "index.js",