Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 41a0278

Browse files
authored
Merge pull request #23 from aws/postmessage-logging
Postmessage logging
2 parents 10768ff + 09ffcf3 commit 41a0278

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws/awsgluenotebooks-extensions",
3-
"version": "0.1.60",
3+
"version": "0.1.61",
44
"description": "A JupyterLab extension.",
55
"keywords": [
66
"amazon",

src/events.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ export interface NotebookEventData {
6363
export const send = (type: NotebookEventTypeValue, payload = '') => {
6464
const event: NotebookEventData = { type, payload };
6565
const parent = window.parent;
66+
67+
const { origin } = window.location;
68+
const jupyterConfigData = JSON.parse(
69+
document.getElementById('jupyter-config-data').textContent
70+
);
71+
fetch(
72+
`${origin}${
73+
jupyterConfigData.baseUrl
74+
}/api/contents?postMessage=${JSON.stringify(event)}`
75+
);
6676
parent.postMessage(event, '*');
6777
};
6878

0 commit comments

Comments
 (0)