Search Type B 20150912

Talk about add-ons and extension development.
User avatar
felbre
Posts: 20
Joined: May 31st, 2005, 7:17 am
Location: Geh€im, Germany
Contact:

Post by felbre »

Thank you!
IE rulez ;-)
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20130526

Post by bugblatter »

On Firefox 29 (Aurora currently), the first version with the Australis UI, the Ctrl+K shortcut to focus the searchbar no longer works. Instead, it loads the default search engine, (www.google.com), which is the default action if there is no searchbar. Will this be fixed in the next version, or is there a possible self-fix I can do? Thanks.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: Search Type B 20130526

Post by dorando »

bugblatter wrote:Will this be fixed in the next version
Yes.
bugblatter wrote:, or is there a possible self-fix I can do? Thanks.
With keyconfig Add a new key containing:

Code: Select all

if (window.fullScreen)
 
FullScreen.mouseoverToggle(true);
searchtypeb.getSearchBar().focus(); 
Support mozilla.dorando.at through donations/contributions.
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Search Type B 20130526

Post by LoudNoise »

Good lord! This thread was started in 2004 and posted to in 2007! Locking. Kindly start a new thread so the earlier folks don't get forum spam announcing that this thread has been replied to.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Search Type B 20130526

Post by LoudNoise »

Unlocked.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
sarahzohar88
Posts: 3
Joined: April 29th, 2014, 3:28 am

Re: Search Type B 20130526

Post by sarahzohar88 »

Yes, i'm also know how the integration of this extension can be conveniently used to get rid of searchbox engine crapola.
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

Testing this out on fx45esr, mostly ok except:

Since they changed the keyword api in fx39, they broke the keyword ui, which has not been updated yet to match. So you have to be careful when adding a new keyword search that it has a unique url to avoid trouble.

For example, if I create a new multi-keyword search by just copying one of the keyword bookmarks and changing the keyword to multiple space-separated keywords, I will mess up the keyword of the original bookmark I copied, because it has the same url (even if it's not actually used here). So I want to create a bookmark from scratch and fill in the url with a unique dummy url (ok since not used in multi-keyword search), like taking the url of one of the existing keyword searches and replacing the '%s' with 'dummy'.

Of course this will probably be moot in a few versions if and when this extension is broken completely by new firefox changes.
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

Also, a minor unoffical bug fix FYI:

The console will give an error if you add a new keyword search (or even just hit Ctrl-Shift-D):

Code: Select all

ReferenceError: ACTION_ADD is not defined
The offending code seems to just update the favicon of the new bookmark.

There are a couple constants used that are undefined in:
searchtypeb@dorando.xpi\bookmarkProperties.xul

So replace

Code: Select all

window.addEventListener("load", function tempFunction(event) {
 window.removeEventListener(event.type, tempFunction, false);
with

Code: Select all

window.addEventListener("load", function tempFunction(event) {
 window.removeEventListener(event.type, tempFunction, false);

 const BOOKMARK_ITEM = 0;
 const BOOKMARK_FOLDER = 1;
 const LIVEMARK_CONTAINER = 2;
 
 const ACTION_EDIT = 0;
 const ACTION_ADD = 1;
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

Looks like firefox 50.0 breaks the search bar. Hitting Enter after typing your search term does nothing (except "event is null" in the console, traced to the ontextentered method in search.xml), though clicking on the go arrow still works.

From what I can tell, ff50 removes the 'mEnterEvent' code in autocomplete.xml, which is relied upon in the extension's search.xml (onTextEntered() argument):

Code: Select all

   <xul:textbox class="searchbar-textbox" flex="1" type="autocomplete" tabscrolling="true" showcommentcolumn="true"
    autocompletepopup="PopupAutoComplete" autocompletesearch="form-history" completeselectedindex="true" maxrows="10"
    timeout="250" ontextentered="this.parentNode.onTextEntered(this.mEnterEvent);"
    xbl:inherits="disabled,disableautocomplete,newlines,placeholder=label" style="min-width: -moz-fit-content"
   >
I'm still trying some stuff, but I don't know much about fixing code, so I was hoping someone might have an idea since dorando may not be around anymore. I know it's kinda moot with xul going away at the end the year, but with ff52-ESR, it would be useful and neat to keep this working a decent way into 2018.

Side note: If your bookmark properties panel keeps growing horizontally a bit everytime you open it (until it's bigger than your screen), it's something this extension is doing. Not sure when it started. Just have to resize it every once in a while.
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

bugblatter wrote:Looks like firefox 50.0 breaks the search bar. Hitting Enter after typing your search term does nothing (except "event is null" in the console, traced to the ontextentered method in search.xml), though clicking on the go arrow still works.
From what I can tell, ff50 removes the 'mEnterEvent' code in autocomplete.xml, which is relied upon in the extension's search.xml (onTextEntered() argument):

Code: Select all

   <xul:textbox class="searchbar-textbox" flex="1" type="autocomplete" tabscrolling="true" showcommentcolumn="true"
    autocompletepopup="PopupAutoComplete" autocompletesearch="form-history" completeselectedindex="true" maxrows="10"
    timeout="250" ontextentered="this.parentNode.onTextEntered(this.mEnterEvent);"
    xbl:inherits="disabled,disableautocomplete,newlines,placeholder=label" style="min-width: -moz-fit-content"
   >
Fixed it (apparently): I took an utter guess and replaced "mEnterEvent" above with "_textEnteredHandler" (from autocomplete.xml), and now it seems to work:
searchtypeb @dorando.xpi:
search.xml:

Code: Select all

    timeout="250" ontextentered="this.parentNode.onTextEntered(this._textEnteredHandler);"
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

Another bug fix (works on ff45.7.0esr and ff51.0.2):
If you select an engine from the dropdown list (ie popup) and click it (or hit Enter), the popup disappears as expected. If there is a subfolder in the list, and you click on an engine in it (or Enter), the popup does not disappear.
The fix:
searchtypeb @dorando.xpi:
search.xml:

Change:

Code: Select all

       oncommand="focus(); select(); onEnginePopupCommand(event); position="after_start"
To:

Code: Select all

       oncommand="focus(); select(); onEnginePopupCommand(event); mSearchMenu.parentNode.open = false;" position="after_start"
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

Another bug fix for ff52: The text of first suggestion (on the first row of the suggestions popup) is missing, replaced by the 'Suggestions' label which moved over from right side of the row. Otherwise the suggestion entry works fine if you select it.

searchtypeb @dorando.xpi:
search.xml:
Just change 'PopupAutoComplete' to 'PopupSearchAutoComplete': (credit: Classic Theme Restorer)

Code: Select all

    autocompletepopup="PopupAutoComplete" autocompletesearch="form-history" completeselectedindex="true" maxrows="10"
To:

Code: Select all

    autocompletepopup="PopupSearchAutoComplete" autocompletesearch="form-history" completeselectedindex="true" maxrows="10"
Now you will get the suggestions popup of the new searchbar (with all the fluff/bloat) which works. To make it look like the old one:
userChrome.css: Add these lines: (credit: Classic Theme Restorer)

Code: Select all

/* Remove header (empty) and footer (list of engines) */
#main-window #PopupSearchAutoComplete .search-panel-header,
#main-window #PopupSearchAutoComplete .search-one-offs { display: none !important; }

/* Remove extra width that extends past searchbar on left */
#main-window #PopupSearchAutoComplete { margin-inline-start: unset !important; }

/* Remove left ws padding of suggestion text */
#main-window #PopupSearchAutoComplete .search-panel-tree > .autocomplete-treebody::-moz-tree-image {
  width: 4px !important;
  padding-inline-start: unset !important;
}

/* Reduce font size of 'Suggestions' comment to the right of 1st suggestion */
#main-window #PopupSearchAutoComplete .search-panel-tree > .autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment)
{ font-size: smaller; }
bugblatter
Posts: 59
Joined: June 21st, 2005, 12:31 am

Re: Search Type B 20150912

Post by bugblatter »

Outstanding bugs (that I know of):
In the bookmarks properties panel:
1. The 'Charset' and 'Post Data' fields are broken in ff52 (or earlier). These seem a little risky for me to work on, and it's advisable I think not to try to edit or add anything to these fields. They don't add anything the the searchbar's main function anyway (AFAIK).
2. Previously mentioned: The bookmark properties panel keeps growing horizontally a bit everytime you open it (until it's bigger than your screen). Eventually you have to manually resize it.
Post Reply