Coder Social home page Coder Social logo

safarikeywordsearchlegacy's Introduction

Safari Keyword Search

Not supported in Safari 12/macOS 10.14 Mojave: Safari Keyword Search is written using the now “legacy” Safari extension API. Starting with Safari 12 these extensions are deprecated, and all new Safari extensions must use the new Safari App Extensions API. This new API does not incude access to the address bar in the same way as the old API, which means that this extension cannot be ported and will be unsupported going forward. Sorry about that.


Safari Keyword Search is a simple extension for Safari 5.1 and above that can change the default Safari search engine and enables keyword searching from the address bar. This is a simple but powerful feature that gives you access to several search engines using simple keywords. For example, you can search Wikipedia for information on monkeys by typing w monkeys in the address bar.

The following searches are included in the default set:

  • a: amazon.com
  • d: duckduckgo.com
  • down: downforeveryoneorjustme.com
  • e: ebay.com
  • g: google.com
  • gl: google.com (“I’m feeling lucky”)
  • gm: maps.google.com
  • imdb: imdb.com
  • so: stackoverflow.com
  • w: en.wikipedia.org
  • wa: wolframalpha.com
  • y: youtube.com

Any search engine can be set as the default. The default search engine will be used when no keyword is provided. The default, uhm, default is regular Google search.

To edit or delete the search engines, or add your own, right-click any web page and select “Keyword Search Settings”. Here you can add keywords and search URLs, and delete or modify the existing ones. Put @@@ in the search URL to insert the search string, or use %%% if you want spaces to be encoded as %20 instead of +. It is also possible to have keyword expansions without search strings, if you just want quick bookmarks.

Limitations

  • In Safari 5.1, the search term cannot contain a colon symbol (:), as this makes Safari believe something is wrong with the URL protocol. Two typical uses for this is to use site:example.com in Google to limit your search to a specific domain, and cache:example.com/article.html to view the Google cache of a specific page. Workarounds for these two cases are provided: Any Google-search containing site= or cache= will convert the = to a :.

Installation

  1. Download the extension file
  2. Double-click it to install
  3. There is no step 3 :-)

safarikeywordsearchlegacy's People

Contributors

arnemart avatar bsdf avatar estum avatar kovuthehusky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

safarikeywordsearchlegacy's Issues

Safari 12 support

Please consider Safari 12 support and or listing on Mac App Store. thank you

Feature request: Search term expansion without escaping

Escaping terms with @@@ is necessary for query string parameters, but does not work in the path part of the URL. This makes it impossible to use with sites like the Internet Web Archive, e.g.:

http://web.archive.org/web/*/blog.edwards-research.com%2F2011%2F05%2Fpreventing-globbing%2F

does not work, whereas this does:

http://web.archive.org/web/*/blog.edwards-research.com/2011/05/preventing-globbing/

This is a feature I use constantly with Firefox, whenever a site is down I just prepend an "archive" search keyword before the URL to append it without escaping.

Not working in Safari 6 on Lion

I can view the contextual menu item and the new configuration page, but this doesn't appear to be working in the new universal search bar in Safari 6. I'm running 10.7.4.

2.2.2, no longer works with Safari 6.0.1

The subject line explains pretty much everything. Ever since I installed 10.8.2 and it came with Safari 6.0.1, Safari Keyword Search 2.2.2 stopped working. All keyword searches are forwarded as-is to the default search engine, whichever it happens to be.

Spaces encoded inconsistently

Spaces seem to be encoded inconsistently. I typed in several words for a shortcut that uses @@@ for the replacement and the first space gets encoded as + while all subsequent spaces turn into %20.

(As an aside, thanks so much for creating this extension and your quick work earlier about answering these issues about encoding spaces!)

Feature Request: If there's no keyword, use native Safari search

Would it be possible to adjust SafariKeywordSearch in such a way that if I don't use a keyword like "yt" for YouTube and just type in random words, Safari reverts to just searching for those words as it would do if SafariKeywordSearch wasn't installed at all?

For me, this is a usability issue, and it's what's keeping me from actually activating SafariKeywordSearch. So I would be glad if the extension could be altered in the above way.

Thanks for your excellent work so far :)

How do I install it?

Can you give some quick install instructions? Thanks!
Never mind. I didn't see the package in the downloads. All you do is double click it.

Default search issues keyword letter

With Safari Keyword Search 2.2.1 on Safari 5.1.7 (OS X 10.6.8 Snow Leopard and 10.7.4 Lion), when no keyword is entered it is expanding it to the Default keyword itself, rather than that keyword's URL expansion.

For example, entering "keyword" in the URL location bar and hitting Enter results in an attempt to open "g".

By the way, my favorite default search is a Google Browse by Name search. Browse By Name acts like "I'm Feeling Lucky" if Google is certain that the first hit is correct, but otherwise returns a normal set of search results.

bug: second word confusion

example: "y so what" (using the default searches) SHOULD search youtube for "so what"

instead it searches stackoverflow (because it recognizes the "so" keyword in the second work) for "what"

Can't use local domains?

Hello!

Not sure if you're tracking issues here or not, but here goes anyway - with SafariKeywordSearch installed I can no longer access simple local domains (i.e. http://mysite/ ) - they automatically use the default search. Makes sense, but it'd be great to find a workaround for this.

I tried adding a keyword for a simple domain (mysite -> http://mysite/) but I got a weird result where nothing happens but I am no longer able to type in the address bar for that particular tab. I have to close it and create a new tab to be able to access the address bar.

Import from Chrome

Here's a handy one-liner that allows you to export Google Chrome's search engines in a format that is compatible with this extension:

sqlite3 ~/Library/Application\ Support/Google/Chrome/Default/Web\ Data \
    "SELECT '{' || GROUP_CONCAT('\"' || keyword || '\":\"' ||
    REPLACE(url, '{searchTerms}', '@@@') || '\"') || '}' from keywords" | pbcopy

This automatically copies the JSON data into the clipboard. Now you just need to paste this into the import field in the popup.

Does not consider Japanese space as delimiting search key

The extension does not consider the Japanese space ' ' as a true space to separate the keyword from the search term.

So assume the following is written with a Japanese keyboard (even the j). This will not work,

j 橋

I believe the problem is that the SPC char is different. Just a guess though.

Spaces in search string

Spaces should become "+" characters for url get requests, instead of turning into "%20" like they do now.

SKS Broken on Safari 5.2 (Developer Preview/Mountain Lion)

A developer preview of Safari 5.2 was released today, the most noticeable difference is an integrated Address and Search field (similiar to Chrome). This seems like a SKS killer. I hope not. While Safari does now search from the location field, its still limited to Google, Yahoo, and Bing. And there's no way to switch on the fly. But SKS doesn't work in the developer preview, and it seems like whatever API you were using won't work anymore. Any non-url gets read by Safari as a web search.

Am I (hopefully) wrong?

how to add support for javascript bookmarks SafariKeywordSearch

first of all this extension has made safari 5.1 practical for everyday use. I use pinboard to organize bookmarks. i use the bookmarklet below every day to add the current page to my pinboard.in bookmarks. it takes no arguments and works fine as a clickable link in the safari 5.1 (native) bookmarks toolbar but SKS can't open it. how can support for this javascript be added?
thanks, matt

javascript:if(document.getSelection){s=document.getSelection();}else{s='';};document.location='https://pinboard.in/add?next=same&url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(s)+'&title='+encodeURIComponent(document.title)

Use of "&"

When you type a search term with the character "&" in it, everything coming after the "&" is not considered in the search. For example, searching for "me & you" results in the google search "me "

Thanks for the helpful extension!

Address bar stays active after enter

When I enter a keyword with argument and press enter, the correct url is substituted in the address field and the webpage is loaded, but the address field stays active and in focus, so I can't immediately navigate on the page, unlike if I enter a URL directly or use the native search. I'm not sure if this is intentional, but I'd like an option for it to be different.

Private browsing

With the Holidays here I am trying to hide my shopping, and I started using Private Browsing. I noticed that if you enable Private Browsing, then quit Safari, the next time you launch, this extension, but only this extension, does not work. If you quit and relaunch again, or if you go Preferences->Extensions and turn extensions off then back on, SafariKeywordSearch works normally again.

Obviously not an important bug, and quite probably a Safari issue, but I did want to let you know.

This is with SL 10.6.8 and Safari 5.1.2.

Japanese text

When the query to be searched contains Japanese text, it is inserted into the URL as "%25u" followed by the hexadecimal code for the Unicode character, instead of inserting as-is.

So for instance, a YouTube search for the query "私は" results in the URL:

http://www.youtube.com/results?search_query=%25u79C1%25u306F

instead of the expected:

http://www.youtube.com/results?search_query=私は

This issue only occurs when the Japanese text is part of the search term; other Japanese text in the URL itself works without any problems.

(Using Safari 6.0 on OS X 10.8. Love the extension, by the way. This one issue aside, it's exactly what I was looking for!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.