Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match more liberally on URL segments #5

Merged
merged 2 commits into from
Sep 6, 2021

Conversation

lucaswilric
Copy link
Contributor

Items only match if the search string a word in the match property from the start. This can be inconvenient, for example when we want to open a tab where Spotify is playing. When playing, the tab title doesn't include the word "Spotify".

Ideally, we could type "spotify" and have the tab match, but the match property looks like Song Name . Artist open.spotify.com/user/<username>. We'll get a match if we type "open.spotify", but not if we type "spotify".

This change splits matchUrl into many elements for more liberal keyword matching. Tabs will now match any subdomain, the root domain, or any element of the path or query.

With this change, the tab from the previous scenario would have a match property of Song Name . Artist open spotify com user <username>. Since this includes the word "spotify", it will match our search string.

Absolutely no offence taken if this is not behaviour you want! Just offering the patch in case you like it.

lucaswilric and others added 2 commits February 17, 2021 12:30
Items only match if the search string prefix-matches a word in the `match` property. This can be inconvenient for, say, a tab where Spotify is playing. We want to type "spotify" and have the tab match, but the `match` property looks like "Song Name . Artist open.spotify.com/user/<username>". Hence, we'll get a match if we type "open.spotify", but not if we type "spotify".

This change splits `matchUrl` into many elements for more liberal keyword matching. Tabs will now match any subdomain, the root domain, or any element of the path or query.
Copy link
Owner

@epilande epilande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Love this!

@epilande epilande merged commit 322193b into epilande:main Sep 6, 2021
@epilande
Copy link
Owner

epilande commented Sep 7, 2021

🚀 This has been released with v1.0.4

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.

None yet

2 participants