clerk/javascript

Not a valid protocol: 'chrome-extension:'

tomasmenezes opened this issue · 2 comments

Preliminary Checks

Reproduction

n/a

Publishable key

n/a

Description

I was trying to get through the initial auth setup on a chrome extension popup with @clerk/chrome-extension but it seems that, much like #3545, the protocol check prevents routing redirects from chrome-extension:.

This also breaks the starter code found in clerk-chrome-extension-starter/v5. Additionally, it seems none of the SSO sign-in account popups are shown with the popup as the origin (also noted in clerk-chrome-extension-starter#1).

Environment

Binaries:
    Node: 22.0.0 - /usr/local/bin/node
    pnpm: 9.4.0 - ~/Library/pnpm/pnpm
Browsers:
    Chrome: 126.0.6478.61
npmPackages:
    @clerk/chrome-extension: ^1.0.18 => 1.0.18

@LekoArts This is still problematic after #3584 due to /core/clerk.ts#L785

// clerk.ts#L785 - navigate
if (toURL.protocol !== 'http:' && toURL.protocol !== 'https:') {
      console.warn('Clerk: Not a valid protocol. Redirecting to /');
      toURL = new URL('/', window.location.href);
}

The hard protocol check automatically redirects to '/'.

You're right 👍 Put up a PR: #3605