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

Method isOpera

src/service/platform-impl.js:74–79  ·  view source on GitHub ↗

* Whether the current browser is an Opera browser. * @return {boolean}

()

Source from the content-addressed store, hash-verified

72 * @return {boolean}
73 */
74 isOpera() {
75 // Chrome UA on Android may include OPR<v> (build code referring to Oreo),
76 // however real Opera puts put a / after OPR and that's the only tell, so
77 // we check for OPR/ instead of OPR
78 return /OPR\/|Opera|OPiOS/i.test(this.navigator_.userAgent);
79 }
80
81 /**
82 * Whether the current browser is an Edge browser.

Callers 7

testUserAgentFunction · 0.95
isSafariMethod · 0.95
isChromeMethod · 0.95
getMajorVersionMethod · 0.95
isSafariFunction · 0.80
isChromeFunction · 0.80
getMajorVersionFunction · 0.80

Calls 1

testMethod · 0.45

Tested by

no test coverage detected