From fae8b8df8882d7a9070e7f072bce0977769d5b6c Mon Sep 17 00:00:00 2001 From: englehardt Date: Wed, 4 Oct 2017 20:20:38 -0400 Subject: [PATCH] Removing battery API instrumentation --- automation/Extension/firefox/data/content.js | 3 -- automation/Extension/firefox/openwpm.xpi | Bin 33322 -> 33303 bytes test/test_extension.py | 30 ------------------- 3 files changed, 33 deletions(-) diff --git a/automation/Extension/firefox/data/content.js b/automation/Extension/firefox/data/content.js index 9ffbc015..37d5cd06 100755 --- a/automation/Extension/firefox/data/content.js +++ b/automation/Extension/firefox/data/content.js @@ -640,9 +640,6 @@ function getPageScript() { instrumentObject(window.GainNode.prototype, "GainNode"); instrumentObject(window.ScriptProcessorNode.prototype, "ScriptProcessorNode"); - // Access to Battery API - instrumentObject(window.BatteryManager.prototype, "BatteryManager"); - console.log("Successfully started all instrumentation."); } + "());"; diff --git a/automation/Extension/firefox/openwpm.xpi b/automation/Extension/firefox/openwpm.xpi index b1e35072a08a3e3c796ff89f32ff3226fcc4c628..0c03c7ee40c3614479d7c84132c6d3ec3cf3c91c 100644 GIT binary patch delta 1590 zcmZ40!Zf{wi6_9DnT3l11o9V6)Kg>vk~|6^G7wA_Yl7JGOn~HME0*Uh96)6oucR>Z z<}Y&b&RrSq@J^C}L3wi|Yo|ng+v0zz@z1(73d)(vug#cy{5(UGR*LB#PG*KZ+}q1* z7zA%ORtN9~tzNWHQ z_D=kD$n$>fT0PZ({N#-%m)~=LuJ$W<{^e+vvkDjY*ohab87OF3=9Db|@GZIiNc}JU zU(P$7e)Y`Tu#h86&v??4AKLAjJ9lL!EV-SQskzE{57V@^mD@M1nI5;A(OGHZLWB5a zSECK(L;m@mXiDFl!RqMUB0DEcN;W3!j~Gt^i<-XXw2JUUjImKl8-7%TS!@pow(Tgk zWyw+d$e=mzLF_%FWTw^D20C4nTh{gNQ;DeGQ?jmq+gG_eF?aWOwXTaj+EgvM!S{gr zxzxrpUTk@hD36m&Q_% zvb)Mv%pm%lQv^SVzNqsb%->3l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n~>RbJxo-J=K`3S+54-)z`@|9o3mUw+^f_5GZ%dU~+!F3P{chD0j$d z@;ePl9rTd7ufOw!4=_^R17k!6#afx5$(!r7K-%vE4Og#y3?kFeK&YmlT&2B^H1a8!H<~fgBM2W@liKtOD@>?Az@F diff --git a/test/test_extension.py b/test/test_extension.py index 3ef48add..08afa27f 100644 --- a/test/test_extension.py +++ b/test/test_extension.py @@ -111,22 +111,6 @@ AUDIO_SYMBOLS = { u"OscillatorNode.stop" } -# Symbols used during battery fingerprinting -BATTERY_SYMBOLS = { - "window.navigator.getBattery", - "BatteryManager.charging", - "BatteryManager.level", - "BatteryManager.chargingTime", - "BatteryManager.dischargingTime", - "BatteryManager.addEventListener" -} -BATTERY_ARGUMENTS = { - '{"0":"chargingtimechange","1":"FUNCTION"}', - '{"0":"chargingchange","1":"FUNCTION"}', - '{"0":"levelchange","1":"FUNCTION"}', - '{"0":"dischargingtimechange","1":"FUNCTION"}' -} - JS_STACK_TEST_URL = u"%s/js_call_stack.html" % utilities.BASE_TEST_URL JS_STACK_TEST_SCRIPT_URL = u"%s/stack.js" % utilities.BASE_TEST_URL @@ -296,20 +280,6 @@ class TestExtension(OpenWPMTest): assert (utc_now - js_time).seconds < MAX_TIMEDELTA assert not db_utils.any_command_failed(db) - def test_battery_fingerprinting(self): - db = self.visit('/battery_fingerprinting.html') - # Check that all calls and methods are recorded - rows = db_utils.get_javascript_entries(db) - observed_symbols = set() - observed_arguments = set() - for script_url, symbol, operation, value, args in rows: - if symbol == "BatteryManager.addEventListener": - observed_arguments.add(args) - observed_symbols.add(symbol) - assert BATTERY_SYMBOLS == observed_symbols - assert BATTERY_ARGUMENTS == observed_arguments - - def test_document_cookie_instrumentation(self): db = self.visit(utilities.BASE_TEST_URL + "/js_cookie.html") rows = db_utils.get_javascript_entries(db, all_columns=True)