From ab293415aa1ad970df2a04c651a4440288798b03 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Fri, 13 Feb 2026 15:26:11 +0530 Subject: [PATCH 1/2] fix(shared/utils): add better utils for extension URL --- components/package.json | 1 + components/src/banner.ts | 11 ++- .../install-required/install-required.ts | 10 +-- components/src/utils.ts | 20 ----- pnpm-lock.yaml | 3 + shared/types/index.ts | 8 ++ shared/utils/extension.ts | 80 +++++++++++++++++++ shared/utils/package.json | 3 +- 8 files changed, 104 insertions(+), 32 deletions(-) create mode 100644 shared/utils/extension.ts diff --git a/components/package.json b/components/package.json index e480420e..535ebd37 100644 --- a/components/package.json +++ b/components/package.json @@ -15,6 +15,7 @@ "devDependencies": { "@interledger/open-payments": "^7.1.3", "@shared/types": "workspace:^", + "@shared/utils": "workspace:^", "publisher-tools-api": "workspace:^", "typescript": "^5.9.3", "vite": "^5.4.20" diff --git a/components/src/banner.ts b/components/src/banner.ts index 98fbc501..65df9255 100644 --- a/components/src/banner.ts +++ b/components/src/banner.ts @@ -15,8 +15,9 @@ import type { BannerPositionKey, BannerFontSize, } from '@shared/types' +import { getExtensionHref } from '@shared/utils/extension' import bannerStyles from './banner.css?raw' -import { getWebMonetizationLinkHref, applyFontFamily } from './utils.js' +import { applyFontFamily } from './utils.js' const DEFAULT_BANNER_TITLE = 'How to support?' const DEFAULT_BANNER_DESCRIPTION = @@ -136,8 +137,6 @@ export class Banner extends LitElement { ? html`` : null - const extensionLink = getWebMonetizationLinkHref(navigator.userAgent) - return html`