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

Adds search feature to commands when the URL includes "{q}" or "%s" #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tballas
Copy link

@tballas tballas commented Nov 20, 2023

Adds search feature to commands when the URL includes "{q}" or "%s"

Replaces "{q}" or "%s" in a URL when using a command with whatever the user types after the command, handles spaces and replaces them with "%20" to URL encode them in a basic way.

Also ensures that when URLs are started they have either http:// or https:// URL schemes, since Chrome requires a URL scheme to start that URL.

Examples

wap add https://duckduckgo.com/?q={q} ddg [default]

When using that command:

wap ddg banana split

Resulting URL used:

https://duckduckgo.com/?q=banana%20split

wap add https://time.is/?q={q} time [default]

When using that command:

wap time paris

Resulting URL used:

https://time.is/?q=paris

wap add https://www.urbandictionary.com/define.php?term={q} ud urban urbandictionary [default]

When using that command:

wap ud snooze

Resulting URL used:

https://www.urbandictionary.com/define.php?term=snooze

Ensured that URLs used when calling WebAppService.StartUrl(url, profile) have either http:// or https:// URL schemes, since Chrome requires a URL scheme to start.
Add the ability to use "{q}" or "%s" when adding new URLs, that will be replaced with terms for web search query when using that URL/command.

Example:
wap add https://duckduckgo.com/?q={q} ddg [default]
When using that command:
wap ddg banana split
Resulting URL used:
https://duckduckgo.com/?q=banana%20split

Another example:
wap add https://time.is/?q={q} time [default]
When using that command:
wap time paris france
Resulting URL used:
https://time.is/?q=paris
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