diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-07 12:47:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-07 16:08:18 -0300 |
commit | f16ff53cf4175d323dd261485415779387fcac65 (patch) | |
tree | d73ec9d9ea789f03f742f8b2c9c2e20f762f9da7 | |
parent | c6f228bf142637eb72456aebabd0483d83402373 (diff) |
also listen for tab title change
-rw-r--r-- | packages/taler-wallet-webextension/src/platform/chrome.ts | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/packages/taler-wallet-webextension/src/platform/chrome.ts b/packages/taler-wallet-webextension/src/platform/chrome.ts index 288119f98..4b9caa714 100644 --- a/packages/taler-wallet-webextension/src/platform/chrome.ts +++ b/packages/taler-wallet-webextension/src/platform/chrome.ts @@ -444,11 +444,14 @@ function registerTalerHeaderListener( info: chrome.tabs.TabChangeInfo, ): Promise<void> { if (tabId < 0) return; - if (info.status !== "complete") return; - const uri = await findTalerUriInTab(tabId); - if (!uri) return; - logger.info(`Found a Taler URI in the tab ${tabId}`); - callback(tabId, uri); + const tabLocationHasBeenUpdated = info.status === "complete" + const tabTitleHasBeenUpdated = info.title !== undefined + if (tabLocationHasBeenUpdated || tabTitleHasBeenUpdated) { + const uri = await findTalerUriInTab(tabId); + if (!uri) return; + logger.info(`Found a Taler URI in the tab ${tabId}`); + callback(tabId, uri); + } } const prevHeaderListener = currentHeaderListener; @@ -540,26 +543,26 @@ function setAlertedIcon(): void { interface OffscreenCanvasRenderingContext2D extends CanvasState, - CanvasTransform, - CanvasCompositing, - CanvasImageSmoothing, - CanvasFillStrokeStyles, - CanvasShadowStyles, - CanvasFilters, - CanvasRect, - CanvasDrawPath, - CanvasUserInterface, - CanvasText, - CanvasDrawImage, - CanvasImageData, - CanvasPathDrawingStyles, - CanvasTextDrawingStyles, - CanvasPath { + CanvasTransform, + CanvasCompositing, + CanvasImageSmoothing, + CanvasFillStrokeStyles, + CanvasShadowStyles, + CanvasFilters, + CanvasRect, + CanvasDrawPath, + CanvasUserInterface, + CanvasText, + CanvasDrawImage, + CanvasImageData, + CanvasPathDrawingStyles, + CanvasTextDrawingStyles, + CanvasPath { readonly canvas: OffscreenCanvas; } declare const OffscreenCanvasRenderingContext2D: { prototype: OffscreenCanvasRenderingContext2D; - new (): OffscreenCanvasRenderingContext2D; + new(): OffscreenCanvasRenderingContext2D; }; interface OffscreenCanvas extends EventTarget { @@ -572,7 +575,7 @@ interface OffscreenCanvas extends EventTarget { } declare const OffscreenCanvas: { prototype: OffscreenCanvas; - new (width: number, height: number): OffscreenCanvas; + new(width: number, height: number): OffscreenCanvas; }; function createCanvas(size: number): OffscreenCanvas { |