Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: rodocop
Date: August 19, 2015 05:55PM

Folks, I need your help!

JamesD, siria and all who masters kmm.

While trying old good extension 'Search+' by jsnj I found some its misbehaviour under KM75:

some of dinamically changed menus don't function properly - when you change some option or do the search it creates new menu items instead of replacing old with new.

1) All the 4 items from 'Search options' are replicated every time you do search
2) Changing 'Site Search Engine' makes new item not deleting old one:



this image illustrates menu after 1 search done (if more - you'll get more 4-lines-blocks of 'Keep-Configure-Move-Change')
Also Search Site engine was changed 2 times (to Scroogle and Bing)

3) 'Previous Searches' list is filled with extra lines: when you make 2-nd search it adds it but also duplicates item for 1-st search - and more: it duplicates items for both searches every time you toggle 'Previous Searches' display in Options.
That extra items not only do clutter the menu but they cannot be cleared by 'Clear previous searches' command as they do not have their own prefs created.

4) The item 'Clear previous searches' also replicates every toggle of 'Previous searches' display:



here on picture it were made only 2 (!) searches and 'Enable Previous searches' was toggled 'off' and then - back 'on'.




I tried to fix the macro or just make it partly usable.

I've commented the command
&_SearchPlusDisplay;
in line 84 (macro '_Search_Init')

and 'Search Options' 4-lines block stopped to replicate.

but I failed to fix other issues. I switched off all Site Search Engines except default Google.

But i cannot fix the 'Previous searches' issues as I cannot understand these menu building loops in macro, sorry.

Can't you help me, folks, as I found this macro by jsnj very convenient...
It works fine in 1.6 but now it's almost broken...

P.S. File used and discussed here is attached now.



Edited 3 time(s). Last edit at 08/19/2015 05:59PM by rodocop.

Attachments: search+.7z (4.9 KB)  
Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: siria
Date: August 19, 2015 09:28PM

Puuh... that's truly horrible!!

And had to struggle quite long now due to complexity, way too many trees to still see the forest, as we say here ;-)
First problem was just to find this menu at all! Had to search inside the kmm to just figure out this menu is not by default the context on the search-button, but one must open a separate menu in TOOLS! Then it slowly dawned on me again, yes there were always optionally 2 context menus on the search button in toolbars.cfg, have been there for all those years, but the default is STILL the oldest one!
Please Dorian, use the modern one on the default skins, "&Web Search" instead of "_Search_Engines" (thanks JH, LOL!)

But back to this macro:
Looks like there's a new bug in KM75, sigh:
overwriting existing menu lines and just changing the name doesn't seem to work, instead it duplicates the line, so there will be 2 lines with identical macro command but different names! With or without $ARG, doesn't matter.
Well possible there are more probs too, can't continue right now.

But at least found a workaround for Previous Searches smiling smiley
Probably same solution for other menu parts too, just a matter of work to find the exact lines yet.

Around line 440, insert a deletion line (entry NAME is empty):

_Search_BuildPrevMenu{
setmenu("_PreviousSearchList",macro,"","_OpenPreviousSearch(".$_p.")",$_loc);
$_PS=getpref(STRING,$_Search_pref_Prev.$_p.".name");

Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: siria
Date: August 19, 2015 11:11PM

Have not yet tested the following, but in theory should hopefully work too... :cool:

around line 370 insert:

_SearchPlusDisplay{
setmenu(_("Search &Options"),macro,"",Search_ToggleEngineLock,0);
setmenu(_("Search &Options"),macro,"",_ConfigureKeyword,1);
setmenu(_("Search &Options"),macro,"",_SearchEngineMove,2);
index($macroModules,";Search+Icon;")>-1? setmenu(_("Search &Options"),macro,"",_ChangeSearchIcon,3) :0;

&_GetSearchDefault;

around line 432 insert 2x:

_TogglePreviousSearch{
menuchecked=(getpref(BOOL, $_Search_pref_Prev.".OFF")!=true);
setmenu(ClearPrevious,macro,"","_ClearPrevSearches");
togglepref(BOOL,$_Search_pref_Prev.".OFF"); $_SubM=""; &_SearchPreviousMenu;
}
_SiteSearchMenu{
setmenu(_("Site Search"),macro,"",Search_SiteSearch,0);
&_GetSiteEngine; setmenu(_Search_Engines,inline,_("Site Search"),-1);



Edited 1 time(s). Last edit at 08/19/2015 11:30PM by siria.

Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: rodocop
Date: August 20, 2015 06:11PM

O, Magic siria!

All your fixes DO work fine! God bless you!!!

If I can ask you a bit more - maybe you'll be able to understand:

why Google site search doesn't really search by site (it does general search unstead) while the same-formed Bing search works fine?



Edited 1 time(s). Last edit at 08/20/2015 06:11PM by rodocop.

Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: siria
Date: August 20, 2015 08:18PM

You too rodocop smiling smiley (PS: and thanks for your help over there ;-)

Frankly I've installed that nice macro since years too, but being a fast typer find myself just typing away in the URL bar, instead of digging through my (extra long) search menu - so never noticed this! Oops... ;-)
(easy, just placing the mouse in the beginning of urlbar and inserting "g site:" and at the end the search words)
But it should be fixed, glad you're doing so much testing.

around line-179, just replace the ending (for google only):

_SiteSearch{
$_host=hostname($URL); $_Search_EngineName=$_host; &_GetSiteEngine;
$_SiteSearchEngine=="bing" ? $_Search_EngineURL= $_bing.$_host ."+":0;
$_SiteSearchEngine=="Google" ? $_Search_EngineURL= $_Google.$_host ."+":0;

Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: rodocop
Date: August 21, 2015 02:09PM

That's it!!!

So I shell attach an updated version 1.0.5 here now.

Attachments: searchplus1.0.5.7z (37.2 KB)  
Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: siria
Date: August 21, 2015 06:02PM

Great thanks, but wondering why scroogle site-search is now commented..? (L-416)
And line-172 contains now some js-code - perhaps an accidential leftover from some tests?

Options: ReplyQuote
Re: Help! I need somebody! grinning smiley Search+ macro for KM 75
Posted by: rodocop
Date: August 21, 2015 08:18PM

AAAAAAhhhh!
"Don't walk too fast"...

Yes, JS is the bookmarklet for Google Site Search - I should delete it, sure!

And Scroogle doesn't work at all so I've commented it.

Now privacy-oriented alternative for Google is StartPage-IxQuick but I don't know if it can perform site search...




UPD.: StartPage can - but I don't understand the format of search url.



UPD.2: I should experiment a bit with StartPage SiteSearch...



Edited 2 time(s). Last edit at 08/21/2015 08:23PM by rodocop.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.