Match Notion app.notion.com native links#20
Open
Sissing wants to merge 1 commit into
Open
Conversation
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 &).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Notion
/native/deep links served fromapp.notion.comare never closed.The predefined Notion pattern only matches
www.notion.so, but Notion now serves its native deep-link redirect fromapp.notion.com. A real example of a link that should close but doesn't:The host is the only reason it fails. The path (
/native/) and thedeepLinkOpenNewTab=trueparam are both present, the pattern just doesn't accept theapp.notion.comhost.The change
Two small things:
app.notion.comandwww.notion.so, so existingwww.notion.solinks keep working.[?&]instead of a bare&before the param, so it also matches whendeepLinkOpenNewTab=trueis 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.comURL above and a fewwww.notion.sovariants (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.