MozillaZine

Search Type B 20150912

Talk about add-ons and extension development.
dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted December 5th, 2004, 1:36 pm

Search Type B adds a Bookmark powered Search Bar. [Firefox]

This extensions adds a new Search Bar (View->Toolbars->Customize) which uses the built-in bookmark keywords as Search Engines. New engines can be added by the "Add a Keyword for this Search" context menu for web form to the Search Folder ("Organize > Set as Search Folder" in the Library) and can be modified like any other bookmark. Other elements like separators can also be added to the folder without harming its operations.

Additional Features:
- Keyword will be prefilled with something random if no Keyword was suggested
- Search Folder is selected for "Add a Keyword for this Search"
- Middle click on an Autocomplete result opens a new Tab (if browser.tabs.opentabfor.middleclick is true)
- Modifiers are supported for keyboard, click, and dragging: Alt/Command/Ctrl = Tab, Command+Shift/Ctrl+Shift = Background Tab, Shift = New Window
- Multiple sites can searched by using a subfolder or by creating a bookmark which has a space separated list of keywords as its keyword.
- Adds Charset and PostData fields to the Bookmark Properties Dialog.
- Includes fixes for bug 237158, 423127, and some others.

Notes:
- Editing the bookmark for the current engine requires reselection for changes to take effect.

Configurations:
Code: Select all
prefs.js: (use about:config to edit these)

// Load Results by default in new tabs
// Default -> Tab, Alt/Command/Ctrl -> Current, Shift -> Background Tab, Alt/Command/Ctrl+Shift -> New Window
user_pref("browser.search.openintab", true);

// The folder id of the Search Folder used to select the default Folder in "Add a Keyword for this Search" or or the Manage menu item
user_pref("searchtypeb.folder", "NC:BookmarksRoot");

// Use the same placeholder for all engines (changing the placeholder clears undo/redo)
user_pref("searchtypeb.overridePlaceholder", "Search");

// The Place URI used to populate the menu
user_pref("searchtypeb.place", "place:folder=BOOKMARKS_MENU&expandQueries=1");

// Use autocomplete results from the "q" parameter (used by Google and others)
user_pref("searchtypeb.param", "q");

// Use autocomplete results from the "game" parameter for the engine with the gamefaqs keyword
user_pref("searchtypeb.param.gamefaqs", "game");

// Don't persist engine change
pref("searchtypeb.persistEngine", false);

// Start group search at first tab (only for searches opening in current tab)
user_pref("searchtypeb.start_groups_at_first_tab", true);

// Remove the searchbar timeout
user_pref("searchtypeb.timeout", 0);

// Use the suggestions from the engine currently selected in the default search box
user_pref("searchtypeb.type", "search-autocomplete");

// Don't set the placeholder attribute (changing the placeholder clears undo/redo), alternatively try overridePlaceholder
pref("searchtypeb.usePlaceholder", false);

// Only allow scroll wheel switching if Alt is down while ScrollLock is on (any combinations of getModifierState values allowed)
pref("searchtypeb.wheelModifier", "ScrollLock Alt");

userChrome.css:
/* Make the enginge selector non-tabbable */
.searchbar-engine-button { -moz-user-focus:ignore; }

/* Hide the placeholder */
.searchbar-textbox ::-moz-placeholder, .searchbar-textbox :-moz-placeholder { color:transparent }

Changes:
20150912:
- Adjusted the editBookmarkOverlay overlay to use the id added by bug 481231
- Adjusted the editBookmarkOverlay overlay for the changes brought by bug 951651
- Adjusted code to not trigger the warning about unreachable code added by bug 1005110
- Adjusted code to not trigger the deprecation warning added by bug 1100294
- Adjusted the getShortcutOrURIAndPostData patch to not unnecessarily unescape postData
- Replaced the keywordField with a menulist to edit keywords undiscoverable since bug 1125113 [Fx39+]
- Added a frame script to replace ContextMenu:SearchFieldBookmarkData [Fx41+]
- Added a patch for PlacesDBUtils.jsm to correctly calculate foreign_count
- Added code to recalculate foreign_count once per session
- Added left padding back to the search engine image
- Added minimal styling for builds with bug 1119250
- Added a patch to GetSearchFieldBookmarkData to work around a typo in ESR (charSet/charset)
- Added multiprocessCompatible
- Removed some obsolete code, including the patch for bug 767939

Full Changelog.
Last edited by dorando on September 21st, 2015, 5:50 am, edited 13 times in total.
Support mozilla.dorando.at through donations/contributions.

kulmegil
 
Posts: 64
Joined: February 16th, 2005, 12:46 pm

Post Posted February 16th, 2005, 12:56 pm

This is extremly handy extension... one of my fav. from "search tools" section.
Just beacause it allows to add new search engines "on the fly" and allows to use folders.

Keep it going...
(just in case - sorry for my english)

Sekundes
 
Posts: 106
Joined: March 1st, 2003, 8:27 am
Location: Asia

Post Posted February 18th, 2005, 5:54 am

Very great extension...
Especially it works well on various encodings.
I have a RFE here, could you please make it possible, at least an option, to list all bookmarks that contains keywords rather than setting the specific search folder?
Thanks in advance.

shakey_snake

User avatar
 
Posts: 1622
Joined: October 25th, 2004, 11:12 pm

Post Posted April 6th, 2005, 8:25 am

What about doing something like this for url bar replacement?
I understand how integration of this extension could be conveniently used to get rid of searchbox engine crapola, but I was thinking.

Most user that know about smart keywords are happy to gain the extra screen space.
The only drawback to them, is that entries need to be X'd and V'd or retyped to search multiple search engines
Couldn't something like this extension be used to have the best of both worlds?

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted April 30th, 2005, 6:23 am

Sekundes wrote:I have a RFE here, could you please make it possible, at least an option, to list all bookmarks that contains keywords rather than setting the specific search folder?
Currently the list is a faked bookmark folder so this might be complicated to implement.

shakey_snake wrote:What about doing something like this for url bar replacement?
I understand how integration of this extension could be conveniently used to get rid of searchbox engine crapola, but I was thinking.

Most user that know about smart keywords are happy to gain the extra screen space.
The only drawback to them, is that entries need to be X'd and V'd or retyped to search multiple search engines
Couldn't something like this extension be used to have the best of both worlds?
So you would want that once the user has selected a keyword (maybe via a popup on the page icon), everything typed into the url bar would be invoked with this keyword until the user quits this mode somehow?

searchtypeb

shakey_snake

User avatar
 
Posts: 1622
Joined: October 25th, 2004, 11:12 pm

Post Posted April 30th, 2005, 9:50 am

I guess, I was thinking (and this was a while a go) that the users last search via keyword would be saved somehow, and clicking the page icon would show a dropdown menu with searches of whatever words were searched.

Example:
  1. I type: "g searchtypeb" into the urlbar. this is over written by the google results page address, just like any normal smart keyword search.
  2. I surf around for an undisclosed amount of time, but google ( and this is hypothetical :D) didn't have what I was looking for,
  3. so I click the page icon and rather than highlighting the text (or in addition to highlighting the urlbar text) get a dropdown menu like the current searchtypeb dropdown menu and clicking on, let's say, the yahoo bookmarklet would
    1. paste "y searchtypeb" into the urlbar where I could press Enter or go or alt+enter or change the entry or whatever
    2. or maybe there could even be an option to just jump straight to the search page

Am I making any sense?

kulmegil
 
Posts: 64
Joined: February 16th, 2005, 12:46 pm

Post Posted May 6th, 2005, 12:55 pm

As I say - I like it a lot...

It would be actually good to have to "seach type B" fields with different bookmark "search folders"

Can you make version that works with trunk builds?
I miss "javascript options" plugin on stable/aviary :)
(just in case - sorry for my english)

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted September 12th, 2005, 5:01 am

20050912:
- Note: Older versions need to be uninstalled before installing this version
- Doesn't try anymore to select the Search Folder in "Add a Keyword for this Search" if it isn't in the list
- Added Charset and PostData fields to the Bookmark Properties Dialog
- Some changes to make it work with current trunk
- Added completeselectedindex="true" so it behaves like the standard bar again
- Added the ability to set the autocomplete param per keyword, see Configurations
- It is now possible to search all engines within an subfolder

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted June 18th, 2006, 10:56 am

20060618:
- Reworked the search bar to mimic the default bar depending on version
- Minor visual fixes to the Bookmark Properties Dialog
- The default 'Web Search' shortcuts should now focus the first <searchbar>
- Changed searchtypeb.load_in_tab to browser.search.openintab as this will be used by Firefox 2.0
- Group searches now reuse tabs beginning with the current (set searchtypeb.start_groups_at_first_tab to start at first tab)
- Replaced the encoder in getShortcutOrURI with something which should more closely mimic form submit (search for c++ works)
- Added searchtypeb.type which can be used to set the autocomple controller. Note that the SearchSuggestion controller depends on the default SearchService so you need to select an engine in the default search box which supports it to get suggestions.
- Removed some legacy code

felbre

User avatar
 
Posts: 20
Joined: May 31st, 2005, 7:17 am
Location: Geh€im, Germany

Post Posted November 6th, 2006, 9:30 am

Hi,

will there be an update for Firefox 2.0? So far Search Type B from June 2006 does not seem to work?

Felix

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted November 7th, 2006, 10:58 am

20061106:
- Some changes to make it work again with Firefox 2

searchtypeb
Support mozilla.dorando.at through donations/contributions.

felbre

User avatar
 
Posts: 20
Joined: May 31st, 2005, 7:17 am
Location: Geh€im, Germany

Post Posted November 9th, 2006, 1:43 am

Wow,

such a quick reaction! I am very pleased about this.

Thanks a lot,
Felix
IE rulez ;-)

felbre

User avatar
 
Posts: 20
Joined: May 31st, 2005, 7:17 am
Location: Geh€im, Germany

Post Posted February 27th, 2007, 2:00 pm

Hello again,

the new released FF 2.0.2 is lacking support for Search Type B again.

I would appreciate an update.

Thanks a lot for your support,
Felix
IE rulez ;-)

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted February 28th, 2007, 4:46 am

Version 20061106 should install/work in Firefox 2.0.0.2, you might need to clear your cache (through Tools > Clear Private Data) and use 'Find Updates' from the Add-ons manager.

felbre

User avatar
 
Posts: 20
Joined: May 31st, 2005, 7:17 am
Location: Geh€im, Germany

Post Posted March 1st, 2007, 1:56 am

dorando wrote:Version 20061106 should install/work in Firefox 2.0.0.2, you might need to clear your cache (through Tools > Clear Private Data) and use 'Find Updates' from the Add-ons manager.


Hello Dorando,

I have installed Search Type B on several computers. On some it is working fine. But on one particular, I got the error message that the add-on wasn't compatible with FF 2.0.0.2 any more after the update. I'll try what you suggested when I am back home.

Thanks,
Felix
IE rulez ;-)

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 3 guests