* Returns the major version of the browser. * @return {number}
()
| 109 | * @return {number} |
| 110 | */ |
| 111 | getMajorVersion() { |
| 112 | if (this.isSafari()) { |
| 113 | return this.isIos() |
| 114 | ? this.getIosMajorVersion() || 0 |
| 115 | : this.evalMajorVersion_(/\sVersion\/(\d+)/, 1); |
| 116 | } |
| 117 | if (this.isChrome()) { |
| 118 | return this.evalMajorVersion_(/(Chrome|CriOS)\/(\d+)/, 2); |
| 119 | } |
| 120 | if (this.isFirefox()) { |
| 121 | return this.evalMajorVersion_(/(Firefox|FxiOS)\/(\d+)/, 2); |
| 122 | } |
| 123 | if (this.isOpera()) { |
| 124 | return this.evalMajorVersion_(/(OPR|Opera|OPiOS)\/(\d+)/, 2); |
| 125 | } |
| 126 | if (this.isEdge()) { |
| 127 | return this.evalMajorVersion_(/Edge\/(\d+)/, 1); |
| 128 | } |
| 129 | return 0; |
| 130 | }, |
| 131 | |
| 132 | /** |
| 133 | * @param {!RegExp} expr |
nothing calls this directly
no test coverage detected