MCPcopy Create free account
hub / github.com/ampproject/amphtml / getIosVersionString

Function getIosVersionString

src/preact/utils/platform.js:155–164  ·  view source on GitHub ↗

* Returns the minor ios version in string. * The ios version can contain two numbers (10.2) or three numbers (10.2.1). * Direct string equality check is not suggested, use startWith instead. * @return {string}

()

Source from the content-addressed store, hash-verified

153 * @return {string}
154 */
155 getIosVersionString() {
156 if (!this.isIos()) {
157 return '';
158 }
159 return (
160 self.navigator.userAgent
161 ?.match(/OS ([0-9]+[_.][0-9]+([_.][0-9]+)?)\b/)?.[1]
162 ?.replace(/_/g, '.') || ''
163 );
164 },
165
166 /**
167 * Returns the major ios version in number.

Callers

nothing calls this directly

Calls 2

isIosMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected