sophie-glk / bang Goto Github PK
View Code? Open in Web Editor NEWA firefox addon which adds bangs (known from duckduckgo) to various search engines.
License: MIT License
A firefox addon which adds bangs (known from duckduckgo) to various search engines.
License: MIT License
If you use bangs that translate from a language to another (e.g. !enit), the search engine redirects you to Google Translate without adding the searched words in the translation form (on DuckDuckgo it works fine).
Edit: thanks to @babastienne for pointing out that the issue is related to a problem with the bangs.json file.
More a suggestion than a issue :
I recommand you to work with gitflow in order to keep your code clean and working.
When the feature is done and fully tested the branch feature/name_of_the_feature is merged on develop.
When the new version of the code is put in production the branch develop is merge into master.
This is a "simplified" version of gitflow that I stated here.
For more informations about gitflow I strongly recommand you to look at those two links :
Using branches on github is definitely the best practise to respect if you want to avoid loosing code or introduce bugs.
Anyway, if you don't care you can just ignore this issue. ๐
If I try to write to it, it search for the words I type in the page.
I tried it on Windows 10 and Fedora Linux, with Firefox 71 stable.
!bang
points to /bang?q={{{s}}}
which means that the final url will be something like moz-extension://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/bang?q={{{s}}}
.
I use the OpenSearch firefox startpage search - the one you get by right clicking in the address bar and clicking Add StartPage.
The search URL is https://www.startpage.com/sp/search?query=test+%21w&cat=web&pl=opensearch&language=english
This doesn't redirect to Wikipedia for me. It does redirect if I click in the on-page search bar on Startpage and press enter there.
While bangs in the beginning of the query are very helpful, DuckDuckGo supports bangs anywhere in the query. Supporting bangs anywhere in the search query can be very useful if you decide to use a bang after typing the query.
Could this feature be added? I looked through the source code and it doesn't look too bad to implement. It would require searching each word in the query for a bang as opposed to just the first word:
Line 15 in 58ac6d3
Example interaction with DuckDuckGo using bangs at the end of the query:
Search: Environment variables !aw
should use the !aw
bang and search the ArchWiki for "Environment variables".
Another DuckDuckGo example:
Search: Environment !aw variables
should again use the !aw
bang and search the ArchWiki for "Environment variables"
It'd be super useful to have this add-on also usable on mobile.
Context :
I'm doing a research in the address bar of firefox.
Example : !g foo bar
My default search engine is ecosia.
Expected behaviour :
The research is intercepted by the extension and the request is changed to search on google. The page displayed is the results of google.
Behaviour :
The request is not intercepted immediately. There is a first request made on ecosia instead of google.
The ecosia result is displayed :
Only after it is displayed the new request is made on google and the page is changing again to display the google results :
Problem :
This multiply the requests made and create a small amount of time where firefox can't be used to do anything else.
Because if I do my research and then promptly change to a second tab then the first tab will display the ecosia research and the google results will be displayed in the second tab.
I thought that the webRequest.onBeforeRequest would be able to intercept the initial request but when looking at your code you already used it so I'm not sure of how to solve this issue, otherwise I would have done a pull request.
Not sure if the description is complete enough to understand the problem. Don't hesitate to ask for more informations in case of need.
In DDG, you can use \
to go straight to the first search result, for example
\yt starless king
to open first search result on youtube of starless king
Or add !
at the end, for example
black hole !
It would be quite useful, especially the \
Using the !g bang includes hl=de in the search term which causes google to display the results in German.
The output link for using the query !g test
is https://www.google.com/search?hl=de&q=test
In DuckDuckGo, when searching abc!b
it would search "abc" using Bing. This addon however just searches abc!b
in the default search engine. I can see how this could be considered a feature, but in my opinion its mildly annoying as I am used to how DuckDuckGo works, and I often carelessly put no space before the !. I my opinion, it would make sense if this addon would emulate DuckDuckGo as closely as possible.
!dit and !demauro should search for words in the Internazionale De Mauro dictionary, and they works fine on DuckDuckGo, but they give a "404 page not found" error when used through the addon.
If I want to use multiple bangs to redirect on the same URL I need to duplicate the URL so I was thinking about using a pattern matching in order to make it easier.
Example
For example if I want to use the bang !spotify to search a music and also want it to works when I use the bang !spoti, today I need this configuration :
Maybe using a pattern like `"spoti"||"spotify" it could work and be like that :
Would it be possible, that you add support for the qwant search engine?
!banggood foobar
:
actual: https://www.foobargood.com/index.php?keywords=bang&cat_id=0&com=search
expected: https://www.banggood.com/index.php?keywords=foobar&cat_id=0&com=search
!tbbtwiki foobar
:
actual: https://bigfoobartheory.wikia.com/wiki/Special:Search?search=bang&fulltext=Search&ns0=1&ns14=1#
expected: https://bigbangtheory.wikia.com/wiki/Special:Search?search=foobar&fulltext=Search&ns0=1&ns14=1#
Also !bkkpost foo
doesn't work, maybe for the same reason as above?
it would be great to have this DDG feature in the extension.
Basically when searching DDG if you just put a !
in your search with a space preceding and following it, it will do an "I'm feeling lucky" and bring you directly to the page of its first result
The search query for this in DDG is quite simple
In my region, this is the query i get for searching something
:
https://duckduckgo.com/?q=something+%21&t=ha&va=j
Also thank you for making this amazing extension. was hoping to use ecosia for ethical reasons but couldn't do without DDG bangs and you've made this possible :)
While testing the last version of the module (currently on the master branch), I noticed that you added a new Beta feature.
While trying to use it, an error message was displayed saying that Firefox was unable to locate the search plugin.
Those links seems to be dead because the return a 404 error :
When I change the bang prefix to something easy to use, it triggers unintended bangs.
Specifically, I would like to prefix it with "space".
I would love to have this option as I usually only use some bangs.
Tested with Firefox Mobile. I'm not sure if this is something you can address, but the regex for detecting a bang on Firefox Mobile (Android) seems to be limited to recognizing single-character bangs
After mistakenly opening an issue on this repo when i meant to do so on this one, I discovered they both are suffering from this problem. It could be a firefox issue, or it could be a difference in how regex is processed on mobile? ๐คทโโ๏ธ
When searching a URL with DuckDuckGo, for example using the Wayback Machine, the URL is converted back into regular plaintext (the url of the search as an example would be https://web.archive.org/web/*/https://www.startpage.com/). Using this extension, the text is still URI encoded, instead searching https://web.archive.org/web/*/https%3A%2F%2Fwww.startpage.com%2F which does not work properly as a search.
On any site Firefox displays annoying notification dot - both inside extensions menu and on toolbar.
Annoying notification dot is displayed on all tabs for any site - aside from sites extension has specifically requested permissions (Google, Bing, ect).
Clicking extension will make it disappear temporary - it will show up on page (re)load.
Thanks for making this addon.
I'm using Startpage, but lately when I search anything it will open the first result instead of showing Startpage results. This happens most of the times, but not always.
Bangs such as !am
will use your search region to determine where to send you, so for me DDG takes me to amazon.co.uk, whereas the extension will always use amazon.com. It'd be great for the extension to support this, as otherwise I have to remember to use the regional variant of the bang, assuming there is one (there is for Amazon, !amuk
in my case).
Custom bang just performs a duckduckgo query with "!custom_bang @search@"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.