Closed alkorang closed 1 month ago
DuckDuckGo bang escapes query properly, while Yang custom bang does not encode. For example, with !g A&B
, DuckDuckGo bang opens https://www.google.com/search?hl=ko&q=A%26B
and searches A&B
properly. Yang custom bang opens https://www.google.com/search?q=A&B=
and searches A
omitting &B
part.
Changing URL Encode Query
option does not change the behavior of Yang custom bang. I guess one solution could be escaping &
in the query
variable in background.js
.
Hi @alkorang, thanks for your detailed reports.
While Yang! does not aim to mirror DuckDuckGo's behavior one-to-one, I believe your concerns are valid.
Yang! custom bang behaves differently. It opens
https://www.google.com/search?q=
page with an empty query. It has no option to configure the page to open with an empty query.
I'm already working on adding an option called "Open Base URL" (similar to what Kagi Search offers), that will just do that, open the base URL. E.g., if the URL was https://github.com/dmlls/yang/issues/6
, with this option on and no query, https://github.com
would be opened. If you still wanted to have a bang redirecting to the entire path, you could simply add a bang with the full URL (and no {{{s}}}
) and the "Open Base URL" option unchecked.
DuckDuckGo bang escapes query properly, while Yang custom bang does not encode.
This must be a bug, will look into it!
Hi @alkorang, the changes are live at https://addons.mozilla.org/addon/yang-addon/.
Please, give it a try and in case there's anything still broken, don't hesitate to open a new issue. Thanks! :)
Hi @dmlls. Everything works perfectly for me. Thank you for the quick update!
I configured Yang custom bang
!g {{{s}}}
to openhttps://www.google.com/search?q={{{s}}}
. I tried tests with and withoutURL Encode Query
option.The original DuckDuckGo bang! with an emtpy query directly opens the first page of the site. For example,
!g
with openshttps://www.google.com
. I guess it opens the link of"d"
element frombang.js
file when there is no keyword.Yang! custom bang behaves differently. It opens
https://www.google.com/search?q=
page with an empty query. It has no option to configure the page to open with an empty query.