[3]: Same as [2], but for mobile. SELECT COUNT(body), SUM(p1), SUM(p2), SUM(p3), SUM(p4), SUM(p5), SUM(p6), SUM(p7), SUM(p8), SUM(p9), SUM(p0), SUM(p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p0 > 0) FROM ( SELECT body, REGEXP_MATCH(body, "![a-zA-Z]+\\.DeviceOrientationEvent") as p1, REGEXP_MATCH(body, "[a-zA-Z]+\\.DeviceOrientationEvent ?\\&\\&|\\&\\& ?[a-zA-Z]+\\.DeviceOrientationEvent") as p2, REGEXP_MATCH(body, "[a-zA-Z]+\\.DeviceOrientationEvent ?\\|\\||\\|\\| ?[a-zA-Z]+\\.DeviceOrientationEvent") as p3, REGEXP_MATCH(body, "== ?[a-zA-Z]+\\.DeviceOrientationEvent|[a-zA-Z]+\\.DeviceOrientationEvent ?==|[a-zA-Z]+\\.DeviceOrientationEvent ?!=") as p4, REGEXP_MATCH(body, "[a-zA-Z]+\\.DeviceOrientationEvent ?\\?") as p5, REGEXP_MATCH(body, "typeof ([a-zA-Z]+\\.)?DeviceOrientationEvent") as p6, REGEXP_MATCH(body, "[a-zA-Z]+\\[[\'\"]DeviceOrientationEvent[\'\"]\\]") as p7, REGEXP_MATCH(body, "[\'\"]DeviceOrientationEvent[\'\"] ?in ?[a-zA-Z]+") as p8, REGEXP_MATCH(body, "if ?\\( ?[a-zA-Z]+\\.DeviceOrientationEvent ?\\)") as p9, REGEXP_MATCH(body, "\\|DeviceOrientationEvent\\||DataView DeviceOrientationEvent Document") as p0, // False positives. FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE url LIKE '%.js' AND body CONTAINS "DeviceOrientationEvent" AND REGEXP_MATCH(body, "DeviceOrientationEvent[^:]") GROUP BY body, p1, p2, p3, p4, p5, p6, p7, p8, p9, p0) Row f0_ f1_ f2_ f3_ f4_ f5_ f6_ f7_ f8_ f9_ f10_ f11_ 1 10010 1945 1474 337 955 187 280 4 1557 506 2963 9501 --> (f11-f10)/(f0-f10) = 92.7% [4]: Same as [3], but without `url LIKE '%.js'` Row f0_ f1_ f2_ f3_ f4_ f5_ f6_ f7_ f8_ f9_ f10_ f11_ 1 13428 2652 2529 448 1133 323 415 6 2249 813 3184 12733 --> (f11-f10)/(f0-f10) = 93.2% [5]: Occurrences of code pattern `if(DeviceOrientationEvent)`. SELECT page, url FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE url LIKE '%.js' AND body CONTAINS "DeviceOrientationEvent" AND REGEXP_MATCH(body, "if ?\\( ?DeviceOrientationEvent ?\\)") LIMIT 100 Row page url 1 https://prod.gq.com/ https://d160accw6snlyf.cloudfront.net/public/js/thetake-injector.js 2 https://intothegloss.com/ https://d160accw6snlyf.cloudfront.net/public/js/thetake-injector.js 3 http://beautyisboring.com/ https://d160accw6snlyf.cloudfront.net/public/js/thetake-injector.js 4 https://www.purewow.com/ https://d160accw6snlyf.cloudfront.net/public/js/thetake-injector.js 5 https://mstag.gq.com/ https://d160accw6snlyf.cloudfront.net/public/js/thetake-injector.js 6 https://www.gq.com/ https://d160accw6snlyf.cloudfront.net/public/js/thetake-injector.js The only site not served over HTTPS has an Alexa rank of 1944803. [6]: Same as [5], but for `new DeviceOrientationEvent`. Row page url 1 https://www.catprint.com/ https://www.catprint.com/assets/application-1dcbc2614efc594a9eee5fdee54bb91ec6735a7cb06952722e4838d2e04e80b0.js Alexa rank 71716. [7]: Same as [5], but for `(evt: DeviceOrientationEvent)`, and without restricting to *.js. Row page url 1 https://playground.babylonjs.com/ https://playground.babylonjs.com/babylon.d.txt 2 https://www.babylonjs-playground.com/ https://www.babylonjs-playground.com/babylon.d.txt This is not JS. [8]: Same as [5], but for `(DeviceOrientationEvent)` more generically: SELECT page, url FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE url LIKE '%.js' AND body CONTAINS "DeviceOrientationEvent" AND REGEXP_MATCH(body, "[a-zA-Z0-9]\\( ?DeviceOrientationEvent?\\)") Result is 3349 sites using `http://static.adsafeprotected.com/sca.17.4.95.js`, which has: function(){return"function"==typeof DeviceOrientationEvent&&a239.a341.a66(DeviceOrientationEvent)} This seems like an extremely popular script, but it correctly implementing feature-probing. [9]: SELECT page, url FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE url LIKE '%.js' AND body CONTAINS "ondeviceorientation" AND REGEXP_MATCH(body, "if ?\\( ?ondeviceorientation?\\)") No results. [10]: Search code snippets for the `ondeviceorientation` event handler attribute. SELECT REGEXP_EXTRACT(reduced_body, "(.{0,99}[^a-zA-Z]ondeviceorientation[^a-zA-Z].{0,99})") AS snippet FROM ( SELECT body, REGEXP_REPLACE(body, "[a-zA-Z]+\\.ondeviceorientation[^.]|typeof ondeviceorientation|\'ondeviceorientation\'|\"ondeviceorientation\"|\\|ondeviceorientation\\|", "") AS reduced_body FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE url LIKE '%.js' AND body CONTAINS "ondeviceorientation" GROUP BY body, reduced_body) WHERE REGEXP_MATCH(reduced_body, "[^a-zA-Z]ondeviceorientation[^a-zA-Z]") GROUP BY snippet Nothing interesting, i.e. no usages that would immediately throw if we removed the attribute. [11]: Same as [3], but counts feature probing for DeviceMotion. SELECT COUNT(body), SUM(p1), SUM(p2), SUM(p3), SUM(p4), SUM(p5), SUM(p6), SUM(p7), SUM(p8), SUM(p9), SUM(p0), SUM(p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p0 > 0) FROM ( SELECT body, REGEXP_MATCH(body, "![a-zA-Z]+\\.DeviceMotionEvent") as p1, REGEXP_MATCH(body, "[a-zA-Z]+\\.DeviceMotionEvent ?\\&\\&|\\&\\& ?[a-zA-Z]+\\.DeviceMotionEvent") as p2, REGEXP_MATCH(body, "[a-zA-Z]+\\.DeviceMotionEvent ?\\|\\||\\|\\| ?[a-zA-Z]+\\.DeviceMotionEvent") as p3, REGEXP_MATCH(body, "== ?[a-zA-Z]+\\.DeviceMotionEvent|[a-zA-Z]+\\.DeviceMotionEvent ?==|[a-zA-Z]+\\.DeviceMotionEvent ?!=") as p4, REGEXP_MATCH(body, "[a-zA-Z]+\\.DeviceMotionEvent ?\\?") as p5, REGEXP_MATCH(body, "typeof ([a-zA-Z]+\\.)?DeviceMotionEvent") as p6, REGEXP_MATCH(body, "[a-zA-Z]+\\[[\'\"]DeviceMotionEvent[\'\"]\\]") as p7, REGEXP_MATCH(body, "[\'\"]DeviceMotionEvent[\'\"] ?in ?[a-zA-Z]+") as p8, REGEXP_MATCH(body, "if ?\\( ?[a-zA-Z]+\\.DeviceMotionEvent ?\\)") as p9, REGEXP_MATCH(body, "\\|DeviceMotionEvent\\||DataView DeviceMotionEvent Document") as p0, // False positives. FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE url LIKE '%.js' AND body CONTAINS "DeviceMotionEvent" AND REGEXP_MATCH(body, "DeviceMotionEvent[^:]") GROUP BY body, p1, p2, p3, p4, p5, p6, p7, p8, p9, p0) Row f0_ f1_ f2_ f3_ f4_ f5_ f6_ f7_ f8_ f9_ f10_ f11_ 1 2984 1597 423 34 79 228 11 31 747 35 25 2835 --> (f11-f10)/(f0-f10) = 95% [12]: Same as [1], but not restricted to *.js, and looks at mobile. SELECT REGEXP_EXTRACT(reduced_body, "(.{0,99}[^a-zA-Z]DeviceOrientationEvent[^a-zA-Z].{0,99})") AS snippet FROM ( SELECT body, REGEXP_REPLACE(body, "[a-zA-Z]+\\.DeviceOrientationEvent[^.]|typeof DeviceOrientationEvent|\'DeviceOrientationEvent\'|\"DeviceOrientationEvent\"|\\|DeviceOrientationEvent\\|", "") AS reduced_body FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE body CONTAINS "DeviceOrientationEvent" GROUP BY body, reduced_body) WHERE REGEXP_MATCH(reduced_body, "[^a-zA-Z]DeviceOrientationEvent[^a-zA-Z]") GROUP BY snippet Three interesting results: onOrientationEvent(evt: DeviceOrientationEvent): void; function(){return"function"==typeof DeviceOrientationEvent&&a239.a341.a66(DeviceOrientationEvent)} return new DeviceOrientationEvent(e,t) [13]: Same as [12], but for DeviceMotionEvent. SELECT REGEXP_EXTRACT(reduced_body, "(.{0,99}[^a-zA-Z]DeviceMotionEvent[^a-zA-Z].{0,99})") AS snippet FROM ( SELECT body, REGEXP_REPLACE(body, "[a-zA-Z]+\\.DeviceMotionEvent[^.]|typeof DeviceMotionEvent|\'DeviceMotionEvent\'|\"DeviceMotionEvent\"|\\|DeviceMotionEvent\\|", "") AS reduced_body FROM [httparchive:response_bodies.2019_01_01_mobile] WHERE body CONTAINS "DeviceMotionEvent" GROUP BY body, reduced_body) WHERE REGEXP_MATCH(reduced_body, "[^a-zA-Z]DeviceMotionEvent[^a-zA-Z]") GROUP BY snippet Two interesting results: a239.a341.a66(DeviceMotionEvent) return new DeviceMotionEvent(e,t)