From c62caffb02856737870cbc79a2cdb43b3e89c363 Mon Sep 17 00:00:00 2001 From: Jayesh Singh Date: Tue, 17 Oct 2023 17:51:16 +0530 Subject: [PATCH] Updated fav-icon Base URL from JupyterLab PageConfig. (#7109) * Updated fav-icon Base URL from JupyterLab PageConfig. * Reformatted code for reability. * Used for conncatinating fac-icon URL * Lint --------- Co-authored-by: jayesh.singh@fplabs.tech Co-authored-by: Jeremy Tuloup --- packages/notebook-extension/src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index e4d217c577..90c86dcd77 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -14,7 +14,7 @@ import { import { Cell, CodeCell } from '@jupyterlab/cells'; -import { Text, Time } from '@jupyterlab/coreutils'; +import { PageConfig, Text, Time, URLExt } from '@jupyterlab/coreutils'; import { IDocumentManager } from '@jupyterlab/docmanager'; @@ -411,8 +411,12 @@ const tabIcon: JupyterFrontEndPlugin = { requires: [INotebookTracker], activate: (app: JupyterFrontEnd, tracker: INotebookTracker) => { // the favicons are provided by Jupyter Server - const notebookIcon = ' /static/favicons/favicon-notebook.ico'; - const busyIcon = ' /static/favicons/favicon-busy-1.ico'; + const baseURL = PageConfig.getBaseUrl(); + const notebookIcon = URLExt.join( + baseURL, + 'static/favicons/favicon-notebook.ico' + ); + const busyIcon = URLExt.join(baseURL, 'static/favicons/favicon-busy-1.ico'); const updateBrowserFavicon = ( status: ISessionContext.KernelDisplayStatus