Skip to content

Commit b46b674

Browse files
committed
feat: log new message events
1 parent cd82232 commit b46b674

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Streamyx",
33
"description": "Intercept DRM requests, view logs from EME session and copy ready commands for Streamyx CLI",
4-
"version": "0.2.0",
4+
"version": "0.3.0",
55
"manifest_version": 2,
66
"background": {
77
"scripts": ["src/worker.js"]

src/drm.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
_this.initDataType = initDataType;
3131
_this.initData = pssh;
3232
if (pssh) window.postMessage({ type: POST_MESSAGE_TYPE, log: { pssh } }, '*');
33+
_this.addEventListener('message', (event) => {
34+
console.groupCollapsed(`[STREAMYX] Session ${_this.sessionId} has new "${event.messageType}" message`);
35+
console.log(`Initialization Data Type: ${_this.initDataType}`);
36+
console.log(`Initialization Data (PSSH): ${_this.initData}`);
37+
if (_this.keyIds) console.log(`Key IDs: ${_this.keyIds}`);
38+
console.log(`Message Type: ${event.messageType}`);
39+
console.log(`Message: ${b64.encode(event.message)}`);
40+
console.groupEnd();
41+
});
3342
return _target.apply(_this, _args);
3443
});
3544

0 commit comments

Comments
 (0)