Skip to content

Commit

Permalink
Open shared link
Browse files Browse the repository at this point in the history
  • Loading branch information
skakker committed Mar 22, 2024
1 parent 3678858 commit 16d449f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ const fileBrowserFactory: JupyterFrontEndPlugin<IFileBrowserFactory> = {
widget.listing.singleClickToUnfold = setting.get('singleClickToUnfold')
.composite as boolean;
});

// check the url in iframe and open
app.restored.then(() => {
console.log(window.location.pathname);
const windowPathname = window.location.pathname;
let treeIndex = windowPathname.indexOf('/tree/');
let path = windowPathname.substring(treeIndex + '/tree/'.length);
path = decodeURIComponent(path);
console.log(`path after decoding is: ${path}`);
docManager.open(path);
});

// Track the newly created file browser.
void tracker.add(widget);
Expand Down

0 comments on commit 16d449f

Please sign in to comment.