Git Product home page Git Product logo

shaka-project / eme_logger Goto Github PK

View Code? Open in Web Editor NEW
99.0 11.0 25.0 971 KB

Logs Encrypted Media Extension (EME) events and calls to help investigate issues in premium media sites.

Home Page: https://chrome.google.com/webstore/detail/eme-call-and-event-logger/cniohcjecdcdhgmlofniddfoeokbpbpb

License: Apache License 2.0

JavaScript 96.86% HTML 3.14%
chrome-extension encrypted-media encrypted-media-extensions widevine widevine-drm drm

eme_logger's People

Contributors

beaufortfrancois avatar beback4u avatar dependabot[bot] avatar github-actions[bot] avatar gvking avatar joeyparrish avatar jrummell-chromium avatar natalieharris avatar shaka-bot avatar vasanthap avatar xhwang-chromium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eme_logger's Issues

[meta] Import open issues

There are open issues in a private bug tracker that should be imported into github now that the github issue tracker has been enabled.

Disable Pointer Events logging by default

Right now when using EME logger, by default it'll log Pointer Events that happened on the HTMLVideoelement (see below for an example). This adds a lot of noise to the log.

We should disable logging Pointer Events by default.

Thu May 18 2023 09:42:32 GMT-0700 (Pacific Daylight Time)
video
HTMLVideoElement pointerrawupdate Event
HTMLVideoElement pointerrawupdate Event instance {
  pointerId: 1,
  width: 1,
  height: 1,
  pressure: 0,
  tiltX: 0,
  tiltY: 0,
  azimuthAngle: 0,
  altitudeAngle: 1.5707963267948966,
  tangentialPressure: 0,
  twist: 0,
  pointerType: "mouse",
  isPrimary: true,
  getCoalescedEvents: Function instance {},
  getPredictedEvents: Function instance {},
  screenX: 100.66667175292969,
  screenY: 255.33334350585938,
  clientX: 62.22222137451172,
  clientY: 92,
  ctrlKey: false,
  shiftKey: false,
  altKey: false,
  metaKey: false,
  button: -1,
  buttons: 0,
  relatedTarget: null,
  pageX: 62.22222137451172,
  pageY: 92,
  x: 62.22222137451172,
  y: 92,
  offsetX: 54.22222137451172,
  offsetY: 84,
  movementX: 5,
  movementY: 0,
  fromElement: null,
  toElement: null,
  layerX: 62,
  layerY: 92,
  getModifierState: Function instance {},
  initMouseEvent: Function instance {},
  view: Window instance,
  detail: 0,
  sourceCapabilities: null,
  which: 0,
  initUIEvent: Function instance {},
}

Publish updated version of EME logger

The version in the Chrome web store is out of date. A new version should be published.

Docs should be updated to show how to build and publish the extension.

keystatuseschange Event should show expiration time in same format as event time.

Currently the keystatuseschange Event shows expiration as a Unix epoch time, for example:

MediaKeySession keystatuseschange Event instance {}
Associated value: {
  expiration: 1648595361000,
  ...
}

It would be nice if it was displayed in a human readable form, e.g. Tue Mar 29 2022 16:09:21 GMT-0700 (Pacific Daylight Time), the same format used to display the event timestamp.

EME Logger and Formatter can't display full string usefully

Migrated from private bug 83064781:

Using the formatter and logger on our test page while playing an L1 clip on ChromeOS, I noticed that the little arrow next to License_Request where we display the contents as a tool-tip is only partially useful. The content is too wide to fit on the display and trying to scroll in any way makes the tool-tip disappear (since you're not mousing-over it anymore)

Clicking 2x on the little arrow doesn't help because it just gives you ""

I probably am not using this in the way I should be. If so, reply to this bug with proper usage as a "Fix"

Support MediaCapabilities::decodingInfo()

MediaCapabilities::decodingInfo() is a new way to create MediaKeySystemAccess. In other words, it's another entry point to EME APIs. Currently this new entry point is not supported by EME logger, and it appears all operations on the MediaKeySession are not logged because of this either.

Now more and more sites start to use MediaCapabilities::decodingInfo(). We should support it in EME logger.

EME Logger uses event time which is meaningless

Migrated from private issue 71637630:

@jrummell-chromium writes:

Using EME logger on https://www.w3c-test.org/encrypted-media/drm-mp4-playback-persistent-license-events.https.html, I see the following in the log generated (some details omitted):

    emeLogger.RemoveCall {timestamp: "11:7:27:783", title: "RemoveCall"}
    emeLogger.PromiseResult {timestamp: "11:7:27:830", title: "RemoveCall Promise Result"}
    emeLogger.KeyStatusesChangeEvent {title: "KeyStatusesChangeEvent", event: Event, timestamp: "16:0:10:23"}
    emeLogger.MessageEvent {title: "MessageEvent", event: MediaKeyMessageEvent, timestamp: "16:0:10:23"}
    emeLogger.UpdateCall {timestamp: "11:7:27:920", title: "UpdateCall"}

Even though this was run at 11 am, the timestamps on the events report 4 pm. I can't determine when the events were actually generated.

Chrome changed a while ago [1] so that the timestamp associated with an event changed from a DOMTimeStamp to a DOMHighResTimeStamp, and it is no longer relative to the epoch. According to [1], it appears possible to convert it to a wall time value. It references a conversion function on GitHub, so maybe that can be used.

I do not know about other browsers. It appears there was a consensus to change to DOMHighResTimeStamp [2]. So using a conversion function would work for them too.

And while you're at it, please fix the formatting of the time stamp. "16:0:10:23" really should be "16:00:10.023" (2 digits for minute/seconds, period before 3 digit ms).

[1] https://developers.google.com/web/updates/2016/01/high-res-timestamps
[2] https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp

EME Call and Event Logger breaks PayPal convert currency

with this extension enabled, clicking on the 3 dots next to a currency in Paypal won't open the convert current pop-up

https://www.paypal.com/myaccount/money/
image

With this extension enabled - the above pop-up menu won't show. Clicking the dots does nothing.

Chrome console:
Refused to load the script 'https://www.googleadservices.com/pagead/conversion_async.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline' https://.paypal.com https://.paypalobjects.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

However this error is unrelated as it shows with the extension enabled or not.
But only when extension disabled does Paypal function correctly

Show MediaKeyMessageEvent.messageType

Currently MediaKeyMessageEvent is displayed as MediaKeySession message event where only the message is shown. It'd be great to also see the MediaKeyMessageEvent.messageType, e.g. license-request or license-renewal.

See the screenshot below for the current behavior:

Capture

Add a handler for closed() attribute on MediaKeySession

MediaKeySession closed() attribute returns a promise which could be resolved when the sessions is closed either by an explicit close() call or some implicit reason. Currently EME logger doesn't handle closed() so if the session is closed by itself we won't see any logs.

It'd be nice to add a handler for the closed() attribute, so we can get a notification, and be able to see the MediaKeySessionClosedSession.

EME logger broke booking.com's pop-up window

It seems the latest EME logger (version 3.1.1) broke booking.com's pop-up window.

Steps to repro:

  • Has EME logger (version 3.1.1) extension enabled
  • Go to booking.com
  • Search for a hotel and click a result
  • Click the "Show on map" on the left panel

Expected:

  • Map shows up in a pop-up window

Actual:

  • Map never shows up.

Note:

  • The problem goes away after disabling EME logger.
  • This can also be reproduced by clicking a room to see details. The pop up window keeps spinning (see attached screenshot).

Sometimes fails to detect video elements

In some cases, the code to detect video elements seems to fail. It should work like this:

  1. Query the document for all existing video elements (synchronous, in _traceExistingElements)
  2. Listen for DOM mutations to catch future video elements (in _setupNewElementObserver)

Somehow, there is a hole in this that allows some video elements to escape notice some of the time. On some pages, reloading a few times will eventually make it work again.

Add karma to run tests

Instead of opening spec_runner.html in a browser, use Karma to run the jasmine tests.

Pollution in global scope

With EME Logger enabled, on an internal site, I get the following error and the page fails to load properly. Without EME Logger enabled the page loads properly.

alerts.js:formatted:1 Uncaught SyntaxError: Identifier 'options' has already been declared (at alerts.js:formatted:1:1)

eme-trace-config.js does define const options = ..., so I assume that alerts.js does the same. The page should probably be changed to use unique names that are unlikely to collide with other pages, or wrap the variables inside a function.

(I also noticed that there are some global functions like byteToHexString. I wonder if they should be renamed (or placed inside a class)?)

Distinguish the origin of what is being traced

If EME Logger is running while there are multiple EME content tabs open and playing, its impossible to tell from which origin the EME Logger is logging from (e.g www.netflix.com, www.hbomax.com, etc).

It would make debugging easier, especially in cases when trying to investigate calls that are overlapping, where the trace is coming from.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.