diff --git a/src/extensions/lens-extension.ts b/src/extensions/lens-extension.ts index 4c9d948e16..ff8758c384 100644 --- a/src/extensions/lens-extension.ts +++ b/src/extensions/lens-extension.ts @@ -56,6 +56,12 @@ export class LensExtension { lpr.extensionOn(this.id, pathSchema, handler); } + removeProtocolHandlers(): void { + const lpr = LensProtocolRouter.getInstance(); + + lpr.removeExtensionHandlers(this.id); + } + get description() { return this.manifest.description; } diff --git a/src/main/protocol-handler/router.ts b/src/main/protocol-handler/router.ts index 2c09b58456..01732b08e0 100644 --- a/src/main/protocol-handler/router.ts +++ b/src/main/protocol-handler/router.ts @@ -186,6 +186,10 @@ export class LensProtocolRouter extends Singleton { this.extentionRoutes.get(id).set(urlSchema, handler); } + public removeExtensionHandlers(id: ExtensionId): void { + this.extentionRoutes.get(id)?.clear(); + } + /** * onMissingExtension registers the handler for when an extension is missing * @param handler If the called handler resolves to true then the routes will be tried again