diff --git a/packages/base/src/manager-base.ts b/packages/base/src/manager-base.ts index f8ea9247f8..a4769006f9 100644 --- a/packages/base/src/manager-base.ts +++ b/packages/base/src/manager-base.ts @@ -481,6 +481,16 @@ abstract class ManagerBase { this._models[i].then(model => { model.comm_live = false; }); }); } + + /** + * Resolve a URL relative to the current notebook location. + * + * The default implementation just returns the original url. + */ + resolveUrl(url: string): Promise { + return Promise.resolve(url); + } + /** * The comm target name to register */ diff --git a/packages/jupyterlab-manager/src/manager.ts b/packages/jupyterlab-manager/src/manager.ts index 93814dbf5a..db946ec240 100644 --- a/packages/jupyterlab-manager/src/manager.ts +++ b/packages/jupyterlab-manager/src/manager.ts @@ -156,6 +156,13 @@ class WidgetManager extends ManagerBase implements IDisposable { this._context = null; } + /** + * Resolve a URL relative to the current notebook location. + */ + resolveUrl(url: string): Promise { + return this.context.resolveUrl(url); + } + /** * Load a class and return a promise to the loaded object. */