I am trying to make an extension that creates and opens up an .ipynb file automatically. I need to get the current notebook panel after opening up the file. I have found that I can use INotebookTracker to get the current notebook
function activate(app:JupyterFrontEnd, notebookTracker: INotebookTracker) {
const nbPanel1: any = notebookTracker;
console.log(nbPanel1)
}
I can see from the console.log that nbPanel1 contains currentWidget, which indeed points to the current NotebookPanel which contains my current file (“renamed.ipynb”) opened.
Hello again, I just found the issue, it was my bad that I didn’t keep the components passed to the active function in the same order I have them in my requires. Once I fixed that, the notebookTracker had information.