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

Method getIosVersionString

src/service/platform-impl.js:173–182  ·  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

171 * @return {string}
172 */
173 getIosVersionString() {
174 if (!this.isIos()) {
175 return '';
176 }
177 return (
178 this.navigator_.userAgent
179 ?.match(/OS ([0-9]+[_.][0-9]+([_.][0-9]+)?)\b/)?.[1]
180 ?.replace(/_/g, '.') || ''
181 );
182 }
183
184 /**
185 * Returns the major ios version in number.

Callers 6

testUserAgentFunction · 0.95
getIosMajorVersionMethod · 0.95
getIosMajorVersionFunction · 0.80
open_Method · 0.80
constructorMethod · 0.80

Calls 2

isIosMethod · 0.95
replaceMethod · 0.45

Tested by

no test coverage detected