Skip to content

Commit 277cb74

Browse files
dbg
1 parent 9165bd5 commit 277cb74

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

kernel/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const kernelPlugin: JupyterLiteServerPlugin<void> = {
1919

2020
// print the app to console
2121
console.log("JupyterLite Embedded Kernel Plugin Activated. App:", app);
22+
// Get the current NotebookPanel instance if available
23+
// @ts-ignore: JupyterLite may expose notebook panel via global or app context
24+
const notebookPanel = (window as any).notebookPanel || app.notebookPanel || null;
25+
console.log("Notebook Panel:", notebookPanel);
2226

2327
app.router.post('/api/kernels/(.*)/interrupt', async (req, kernelId: string) => {
2428
const kernel = activeKernels.get(kernelId);
@@ -73,7 +77,12 @@ const kernelPlugin: JupyterLiteServerPlugin<void> = {
7377
activeKernels.set(kernel.id, kernel);
7478

7579
// print the app to console
76-
console.log("JupyterLite Embedded Kernel Plugin Later app show:", app);
80+
console.log("JupyterLite Embedded Kernel Plugin Later app show:", app);
81+
82+
// Get the current NotebookPanel instance if available
83+
// @ts-ignore: JupyterLite may expose notebook panel via global or app context
84+
const notebookPanel = (window as any).notebookPanel || app.notebookPanel || null;
85+
console.log("Notebook Panel Later:", notebookPanel);
7786

7887
return kernel;
7988
}

0 commit comments

Comments
 (0)