@@ -45,6 +45,13 @@ window.os_detect.getVersion = function(){
45
45
var version = "" ;
46
46
var unknown_fingerprint = null ;
47
47
48
+ var css_is_valid = function ( prop , propCamelCase , css ) {
49
+ if ( ! document . createElement ) return false ;
50
+ var d = document . createElement ( 'div' ) ;
51
+ d . setAttribute ( 'style' , prop + ": " + css + ";" )
52
+ return d . style [ propCamelCase ] === css ;
53
+ }
54
+
48
55
//--
49
56
// Client
50
57
//--
@@ -179,12 +186,15 @@ window.os_detect.getVersion = function(){
179
186
if ( ! ua_version || 0 == ua_version . length ) {
180
187
ua_is_lying = true ;
181
188
}
182
- } else if ( ! document . all && navigator . taintEnabled ) {
189
+ } else if ( ! document . all && navigator . taintEnabled ||
190
+ 'MozBlobBuilder' in window ) {
183
191
// Use taintEnabled to identify FF since other recent browsers
184
192
// implement window.getComputedStyle now. For some reason, checking for
185
193
// taintEnabled seems to cause IE 6 to stop parsing, so make sure this
186
194
// isn't IE first.
187
- //
195
+
196
+ // Also check MozBlobBuilder because FF 9.0.1 does not support taintEnabled
197
+
188
198
// Then this is a Gecko derivative, assume Firefox since that's the
189
199
// only one we have sploits for. We may need to revisit this in the
190
200
// future. This works for multi/browser/mozilla_compareto against
@@ -201,19 +211,20 @@ window.os_detect.getVersion = function(){
201
211
ua_version = '21.0'
202
212
} else if ( 'imul' in Math ) {
203
213
ua_version = '20.0'
204
- } else if ( 'HTMLCanvasElement' in window &&
205
- 'toBlob' in HTMLCanvasElement . prototype ) {
214
+ } else if ( css_is_valid ( 'font-size' , 'fontSize' , '23vmax' ) ) {
215
+ // this is fuxored
206
216
ua_version = '19.0'
207
217
} else if ( 'devicePixelRatio' in window ) {
208
218
ua_version = '18.0'
209
- } else if ( 'HTMLIFrameElement' in window &&
210
- 'sandbox' in HTMLIFrameElement . prototype ) {
219
+ } else if ( 'createElement' in document &&
220
+ document . createElement ( 'iframe' ) &&
221
+ 'sandbox' in document . createElement ( 'iframe' ) ) {
211
222
ua_version = '17.0'
212
- } else if ( 'CSS2Properties' in window &&
213
- 'animation' in CSS2Properties . prototype ) {
223
+ } else if ( 'mozApps' in navigator && 'install' in navigator . mozApps ) {
214
224
ua_version = '16.0'
215
225
} else if ( 'HTMLSourceElement' in window &&
216
- 'media' in HTMLSourceElement . prototype ) {
226
+ HTMLSourceElement . prototype &&
227
+ 'media' in HTMLSourceElement . prototype ) {
217
228
ua_version = '15.0'
218
229
} else if ( 'mozRequestPointerLock' in document . body ) {
219
230
ua_version = '14.0'
@@ -223,7 +234,9 @@ window.os_detect.getVersion = function(){
223
234
ua_version = "12.0" ;
224
235
} else if ( 'mozVibrate' in navigator ) {
225
236
ua_version = "11.0" ;
226
- } else if ( 'mozCancelFullScreen' in document ) {
237
+ } else if ( css_is_valid ( '-moz-backface-visibility' , 'MozBackfaceVisibility' , 'preserve-3d' ) ) {
238
+ ua_version = "10.0" ;
239
+ } else if ( 'doNotTrack' in navigator ) {
227
240
ua_version = "9.0" ;
228
241
} else if ( 'insertAdjacentHTML' in document . body ) {
229
242
ua_version = "8.0" ;
@@ -248,7 +261,6 @@ window.os_detect.getVersion = function(){
248
261
} else {
249
262
ua_version = "1" ;
250
263
}
251
-
252
264
if ( navigator . oscpu != navigator . platform ) {
253
265
ua_is_lying = true ;
254
266
}
0 commit comments