Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate JS instrument config from table #738

Merged
merged 2 commits into from Sep 11, 2020
Merged

Separate JS instrument config from table #738

merged 2 commits into from Sep 11, 2020

Conversation

englehardt
Copy link
Collaborator

This moves the js instrumentation config to a separate line so it doesn't create a huge and unreadable table. While we'd like to find a better way to output this information in the future, this removes the unnecessary messiness until then.

Closes #733.

@englehardt
Copy link
Collaborator Author

Before (looks particularly bad when the output is wrapped):

Keys:
{
  "browser_id": 0,
  "adblock-plus": 1,
  "bot_mitigation": 2,
  "browser": 3,
  "callstack_instrument": 4,
  "cookie_instrument": 5,
  "disconnect": 6,
  "display_mode": 7,
  "donottrack": 8,
  "extension_enabled": 9,
  "ghostery": 10,
  "http_instrument": 11,
  "https-everywhere": 12,
  "js_instrument": 13,
  "js_instrument_settings": 14,
  "navigation_instrument": 15,
  "prefs": 16,
  "random_attributes": 17,
  "recovery_tar": 18,
  "save_content": 19,
  "tp_cookies": 20,
  "tracking-protection": 21,
  "ublock-origin": 22
}

  0  1      2      3        4      5      6      7         8      9     10     11     12     13     14                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          15     16    17     18    19     20      21     22
---  -----  -----  -------  -----  -----  -----  --------  -----  ----  -----  -----  -----  -----  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  -----  ----  -----  ----  -----  ------  -----  -----
  1  False  False  firefox  False  False  False  headless  False  True  False  False  False  False  [{"object": window['ScriptProcessorNode'].prototype, "instrumentedName": "ScriptProcessorNode", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['GainNode'].prototype, "instrumentedName": "GainNode", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['AnalyserNode'].prototype, "instrumentedName": "AnalyserNode", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['OscillatorNode'].prototype, "instrumentedName": "OscillatorNode", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['OfflineAudioContext'].prototype, "instrumentedName": "OfflineAudioContext", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['AudioContext'].prototype, "instrumentedName": "AudioContext", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['RTCPeerConnection'].prototype, "instrumentedName": "RTCPeerConnection", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['HTMLCanvasElement'].prototype, "instrumentedName": "HTMLCanvasElement", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['Storage'].prototype, "instrumentedName": "Storage", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window.navigator, "instrumentedName": "window.navigator", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window['CanvasRenderingContext2D'].prototype, "instrumentedName": "CanvasRenderingContext2D", "logSettings": {"propertiesToInstrument": [], "nonExistingPropertiesToInstrument": [], "excludedProperties": ["drawImage", "lineTo", "closePath", "moveTo", "quadraticCurveTo", "translate", "setTransform", "beginPath", "globalAlpha", "transform", "canvas", "clearRect"], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window, "instrumentedName": "window", "logSettings": {"propertiesToInstrument": ["sessionStorage", "name", "localStorage"], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window.document, "instrumentedName": "window.document", "logSettings": {"propertiesToInstrument": ["cookie", "referrer"], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": true, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}, {"object": window.screen, "instrumentedName": "window.screen", "logSettings": {"propertiesToInstrument": ["colorDepth", "pixelDepth"], "nonExistingPropertiesToInstrument": [], "excludedProperties": [], "logCallStack": false, "logFunctionsAsStrings": false, "logFunctionGets": false, "preventSets": false, "recursive": false, "depth": 5}}]  False  {}    False        False  always  False  False

========== Input profile tar files ==========
  No profile tar files specified

========== Output (archive) profile dirs ==========
  No profile archive directories specified

After:

========== Browser Configuration ==========
Keys:
{
  "browser_id": 0,
  "adblock-plus": 1,
  "bot_mitigation": 2,
  "browser": 3,
  "callstack_instrument": 4,
  "cookie_instrument": 5,
  "disconnect": 6,
  "display_mode": 7,
  "donottrack": 8,
  "extension_enabled": 9,
  "ghostery": 10,
  "http_instrument": 11,
  "https-everywhere": 12,
  "js_instrument": 13,
  "navigation_instrument": 14,
  "prefs": 15,
  "random_attributes": 16,
  "save_content": 17,
  "tp_cookies": 18,
  "tracking-protection": 19,
  "ublock-origin": 20
}

  0  1      2      3        4     5     6      7         8      9     10     11    12     13    14    15    16     17     18      19     20
---  -----  -----  -------  ----  ----  -----  --------  -----  ----  -----  ----  -----  ----  ----  ----  -----  -----  ------  -----  -----
  2  False  False  firefox  True  True  False  headless  False  True  False  True  False  True  True  {}    False  False  always  False  False

========== JS Instrument Settings ==========
{
  "2": "[{\"object\": window['ScriptProcessorNode'].prototype, \"instrumentedName\": \"ScriptProcessorNode\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['GainNode'].prototype, \"instrumentedName\": \"GainNode\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['AnalyserNode'].prototype, \"instrumentedName\": \"AnalyserNode\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['OscillatorNode'].prototype, \"instrumentedName\": \"OscillatorNode\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['OfflineAudioContext'].prototype, \"instrumentedName\": \"OfflineAudioContext\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['AudioContext'].prototype, \"instrumentedName\": \"AudioContext\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['RTCPeerConnection'].prototype, \"instrumentedName\": \"RTCPeerConnection\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['HTMLCanvasElement'].prototype, \"instrumentedName\": \"HTMLCanvasElement\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['Storage'].prototype, \"instrumentedName\": \"Storage\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window.navigator, \"instrumentedName\": \"window.navigator\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window['CanvasRenderingContext2D'].prototype, \"instrumentedName\": \"CanvasRenderingContext2D\", \"logSettings\": {\"propertiesToInstrument\": [], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [\"setTransform\", \"translate\", \"beginPath\", \"clearRect\", \"drawImage\", \"closePath\", \"canvas\", \"globalAlpha\", \"lineTo\", \"moveTo\", \"transform\", \"quadraticCurveTo\"], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window, \"instrumentedName\": \"window\", \"logSettings\": {\"propertiesToInstrument\": [\"name\", \"sessionStorage\", \"localStorage\"], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window.document, \"instrumentedName\": \"window.document\", \"logSettings\": {\"propertiesToInstrument\": [\"referrer\", \"cookie\"], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": true, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}, {\"object\": window.screen, \"instrumentedName\": \"window.screen\", \"logSettings\": {\"propertiesToInstrument\": [\"colorDepth\", \"pixelDepth\"], \"nonExistingPropertiesToInstrument\": [], \"excludedProperties\": [], \"logCallStack\": false, \"logFunctionsAsStrings\": false, \"logFunctionGets\": false, \"preventSets\": false, \"recursive\": false, \"depth\": 5}}]"
}

========== Input profile tar files ==========
  No profile tar files specified

========== Output (archive) profile dirs ==========
  No profile archive directories specified

@codecov
Copy link

codecov bot commented Aug 24, 2020

Codecov Report

Merging #738 into master will increase coverage by 1.69%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #738      +/-   ##
==========================================
+ Coverage   39.16%   40.86%   +1.69%     
==========================================
  Files          29       29              
  Lines        3176     3184       +8     
==========================================
+ Hits         1244     1301      +57     
+ Misses       1932     1883      -49     
Impacted Files Coverage Δ
automation/utilities/platform_utils.py 83.33% <100.00%> (+3.78%) ⬆️
automation/BrowserManager.py 49.21% <0.00%> (+0.39%) ⬆️
automation/Commands/browser_commands.py 16.66% <0.00%> (+0.47%) ⬆️
automation/Commands/Types.py 79.36% <0.00%> (+1.58%) ⬆️
automation/Commands/utils/webdriver_utils.py 21.59% <0.00%> (+2.27%) ⬆️
automation/Commands/command_executor.py 19.23% <0.00%> (+3.84%) ⬆️
automation/TaskManager.py 78.36% <0.00%> (+5.64%) ⬆️
automation/js_instrumentation.py 96.07% <0.00%> (+20.58%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44c1060...ef1afcf. Read the comment docs.

@birdsarah
Copy link
Contributor

Thanks for doing this @englehardt

@vringar vringar self-requested a review September 7, 2020 15:08
@vringar
Copy link
Contributor

vringar commented Sep 7, 2020

I made one minor change r+ from me.

@vringar vringar merged commit 1ad7d5a into master Sep 11, 2020
@vringar vringar deleted the issue_733 branch September 11, 2020 13:43
Zaxeli pushed a commit to Zaxeli/OpenWPM that referenced this pull request Aug 10, 2021
Co-authored-by: Stefan Zabka <szabka@mozilla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull js instrument config out of table
3 participants