openwpm.js_instrumentation module

openwpm.js_instrumentation.clean_js_instrumentation_settings(user_requested_settings: List[Any]) List[Dict[str, Any]][source]

Convert user input JSinstrumentation settings to full settings object.

Accepts a list. From the list we need to parse each item. Examples of the settings we accept.

` // Collections "collection_fingerprinting", // APIs, with or without settings details "XMLHttpRequest", {"XMLHttpRequest": {"excludedProperties": ["send"]}}, // APIs with shortcut to includedProperties {"Prop1": ["hi"], "Prop2": ["hi2"]}, {"XMLHttpRequest": ["send"]}, "Storage", // Specific instances on window {"window.document": ["cookie", "referrer"]}, {"window": ["name", "localStorage", "sessionStorage"]} `

Parameters:

user_requested_settings (list) – The list of JS Instrumentation settings requested by the user, which may include syntactic shortcuts as outlined in method docs.

Returns:

List of all requested JS Instrumentation with all settings applied. Has been nominally de-duped and validated against js_instrument_settings.schema`.

Return type:

list

openwpm.js_instrumentation.get_default_log_settings()[source]

Returns a dictionary of default instrumentation settings.

The set of instrumentation settings to be used when others are not provided. The specification of these settings is detailed in js_instrument_settings.schema.

Returns:

Dictionary of default instrumentation settings

Return type:

dict