Skip to content

Commit

Permalink
fix: Skip additional noisy properties
Browse files Browse the repository at this point in the history
Skips DOM-related methods on media elements and the sessionId getter
on MediaKeySession.

Change-Id: I5cc4749216a87613d346ea6ef3872e4ca17f533c
  • Loading branch information
joeyparrish committed Nov 4, 2021
1 parent c39f9a0 commit 16ae0f5
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions eme-trace-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,20 +259,24 @@ const options = {
TraceAnything.traceMember(navigator, 'requestMediaKeySystemAccess', options);
TraceAnything.traceMember(
navigator.mediaCapabilities, 'decodingInfo', combineOptions(options, {
// The result from decodingInfo is a plain object. We need to dive into
// this field in particular to find MediaKeySystemAccess instances to
// trace.
exploreResultFields: ['keySystemAccess'],
}));
// The result from decodingInfo is a plain object. We need to dive into
// this field in particular to find MediaKeySystemAccess instances to
// trace.
exploreResultFields: ['keySystemAccess'],
}));

// These constructors are not used directly, but this registers them to the
// tracing system so that instances we find later will be shimmed.
TraceAnything.traceClass(MediaKeys, options);
TraceAnything.traceClass(MediaKeySystemAccess, options);
TraceAnything.traceClass(MediaKeySession, combineOptions(options, {
// Also skip logging certain noisy properites on MediaKeySession.
skipProperties: options.skipProperties.concat([
// Also skip logging certain noisy properites on MediaKeySession.
'expiration',

// This is still logged in the representation of the session, but we don't
// need to log access to the property's getter.
'sessionId',
]),
}));

Expand All @@ -287,6 +291,14 @@ const elementOptions = combineOptions(options, {
'progress',
'timeupdate',
],

// Methods we don't care about on media elements:
skipProperties: options.skipProperties.concat([
'getAttribute',
'getBoundingClientRect',
'querySelector',
'querySelectorAll',
]),
});
TraceAnything.traceElement('video', elementOptions);
TraceAnything.traceElement('audio', elementOptions);

0 comments on commit 16ae0f5

Please sign in to comment.