Skip to content

Match Notion app.notion.com native links#20

Open
Sissing wants to merge 1 commit into
sethcottle:mainfrom
Sissing:fix/notion-app-domain
Open

Match Notion app.notion.com native links#20
Sissing wants to merge 1 commit into
sethcottle:mainfrom
Sissing:fix/notion-app-domain

Conversation

@Sissing
Copy link
Copy Markdown

@Sissing Sissing commented May 29, 2026

What this fixes

Notion /native/ deep links served from app.notion.com are never closed.

The predefined Notion pattern only matches www.notion.so, but Notion now serves its native deep-link redirect from app.notion.com. A real example of a link that should close but doesn't:

https://app.notion.com/native/p/<page>?source=copy_link&deepLinkOpenNewTab=true

The host is the only reason it fails. The path (/native/) and the deepLinkOpenNewTab=true param are both present, the pattern just doesn't accept the app.notion.com host.

The change

- ^https?://www\.notion\.so/native/.*&deepLinkOpenNewTab=true
+ ^https?://(app\.notion\.com|www\.notion\.so)/native/.*[?&]deepLinkOpenNewTab=true

Two small things:

  • Match both app.notion.com and www.notion.so, so existing www.notion.so links keep working.
  • Use [?&] instead of a bare & before the param, so it also matches when deepLinkOpenNewTab=true is the first query param (?deepLinkOpenNewTab=true), not only when it follows another one.

This isn't Safari-specific. The host was wrong everywhere, so this helps all browsers.

Testing

I verified the regex against the real app.notion.com URL above and a few www.notion.so variants (param first vs later), plus negative cases (plain Notion pages without the param don't match). I haven't yet confirmed the full close end to end in the browser, so it'd be good to sanity-check that a real Notion native link closes with this applied.

Notion now serves its native deep-link redirect from app.notion.com, but
the pattern only matched www.notion.so, so those tabs were never closed.
Match both hosts, and accept the deepLinkOpenNewTab param whether it is the
first query param or a later one ([?&] instead of a bare &).
@Sissing Sissing marked this pull request as ready for review May 29, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant