General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Location/adress Bar - Bookmark suggestion
Posted by: Rain
Date: November 17, 2014 05:03PM

As i recall, before i reinstalled my OS, i've been using K-Meleon 74 (stable) portable and had it set that everytime i tipe something in the adress bar i would get bookmark suggestions.

For ex. if i was typing in the adress bar "kme" and i had the kmeleon page bookmarked, K-Meleon would drop a suggestion with the site i bookmarked.

Tough idk what exactly i tweaked to make it behave like that. Any help?



Edited 1 time(s). Last edit at 11/17/2014 05:05PM by Rain.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: JohnHell
Date: November 17, 2014 05:33PM

Looks like I didn't post the actual answer even I remember I posted to Zere3k or someone else...

Anyway:

browser.urlbar.matchBehavior
browser.urlbar.default.behavior

Those prefs control how it is matched (1) and what it is matched (2).

For example I have 3 and 17(1+16), this is beginning and history.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: Rain
Date: November 18, 2014 12:13PM

I can't believe they removed that option... they're practically forcing you to learn basic programming skills just so that you can edit internaly your browser's parameters so that it would behave as it should have.

Both Pale Moon (XP version) and the latest version of FF already have this in the settings/preff panel to be enabled at need.

This is a huge step backwords for both K-Meleon and SeaMonkey...

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: JohnHell
Date: November 18, 2014 02:08PM

Removed? Was even sometime there?

You have, in "Finding Websites" section of preferences window to search in history when typing, but not for bookmarks. I can't remember that.

Also, don't take my advice/answer as the correct, as I tend to do these things the hard way through about:config tongue sticking out smiley

I had to search that exact preference because in K-meleon 74, due to GRE 24, the match was messed up, matching the full url and not at the beginning.



Edited 1 time(s). Last edit at 11/18/2014 02:09PM by JohnHell.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: Rain
Date: November 18, 2014 02:58PM

This is what i'm talking about John:




Now my memory isn't what it used to be but as far as i recall prior to me reinstalling my OS i could do the SAME thing in K-Meleon. Type a word in the adress bar and i would get search suggestions from my bookmarks in my adress bar. Also i don't keep history, so only my bookmarks should drop a reults bar.

Could i be delusional? And K-Meleon never had this feature? O.o



Edited 1 time(s). Last edit at 11/18/2014 03:08PM by Rain.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: JohnHell
Date: November 18, 2014 04:56PM

I don't know, but I ever matched history, even in Seamonkey where I never tweaked anything like this.

If fact, you are right this is available in Firefox, and came in K-meleon 74, that is what forced me to change the behavior, because was matching everything I didn't want except history.

In K-meleon 1.6 the option in preferences is the same:

imag

And after test, even in K-meleon 74 that option doesn't change anything in browser prefs, so... now may be doing nothing sad smiley

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: JamesD
Date: November 19, 2014 12:43AM

Regarding
browser.urlbar.matchBehavior
browser.urlbar.default.behavior

I have not found that the prefs, or any control for them ever existed in K-Meleon.

I have created a menu item for their control. To be correct there needs to be a default included in kmprefs.js file. After line 40 add the following line:
pref("browser.urlbar.matchBehavior", 1); // Mozilla default

bkmksbehav.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)

# 		bkmksbehav.kmm
#               Set urlbar/bookmark suggestion filters
# Dependencies	: main.kmm, bookmarks.dll
# Resources	: -
# Preferences	: "browser.urlbar.matchBehavior" and "browser.urlbar.default.behavior"
#                 "kmeleon.urlbar.default.behavior.[1-8]"
# Version	: 0.8   2014_11_18
# Author	: JamesD 
# -----------------------------------------------------------------------------------

bkmksbehav_Search_anywhere {
menuchecked = getpref(INT, "browser.urlbar.matchBehavior")== 0; 
macroinfo = _("Search all available text, disregard word boundaries.");
setpref(INT, "browser.urlbar.matchBehavior", 0);
}
bkmksbehav_boundaries_first {
menuchecked = getpref(INT, "browser.urlbar.matchBehavior")== 1; 
macroinfo = _("Use word boundaries first, then try matching anywhere in the text.)");
setpref(INT, "browser.urlbar.matchBehavior", 1);
}
bkmksbehav_only_boundaries {
menuchecked = getpref(INT, "browser.urlbar.matchBehavior")== 2; 
macroinfo = _("Search only at word boundaries.");
setpref(INT, "browser.urlbar.matchBehavior", 2);
}
bkmksbehav_only_start {
menuchecked = getpref(INT, "browser.urlbar.matchBehavior")== 3; 
macroinfo = _("Match only the start of page URLs and titles.");
setpref(INT, "browser.urlbar.matchBehavior", 3);
}
## --------------------------------
bkmksbehav_Restrict_History {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.1")== 1; 
macroinfo = _("Restrict: History.");
togglepref(INT, "kmeleon.urlbar.default.behavior.1", 1,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Restrict_Bookmarks {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.2")== 2; 
macroinfo = _("Restrict: Bookmarks.");
togglepref(INT, "kmeleon.urlbar.default.behavior.2", 2,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Restrict_Tags {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.3")== 4; 
macroinfo = _("Restrict: Tags.");
togglepref(INT, "kmeleon.urlbar.default.behavior.3", 4,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Match_Title {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.4")== 8; 
macroinfo = _("Match: Title.");
togglepref(INT, "kmeleon.urlbar.default.behavior.4", 8,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Match_URL {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.5")== 16; 
macroinfo = _("Match: URL.");
togglepref(INT, "kmeleon.urlbar.default.behavior.5", 16,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Restrict_Typed {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.6")== 32; 
macroinfo = _("Restrict: Typed.");
togglepref(INT, "kmeleon.urlbar.default.behavior.6", 32,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Restrict_JavaScript {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.7")== 64; 
macroinfo = _("Restrict: JavaScript.");
togglepref(INT, "kmeleon.urlbar.default.behavior.7", 64,0);
macros("_bkmksbehav_sums") ;
}
bkmksbehav_Restrict_Open_Tabs {
menuchecked = getpref(INT, "kmeleon.urlbar.default.behavior.8")== 128; 
macroinfo = _("Restrict: Open Tabs.");
togglepref(INT, "kmeleon.urlbar.default.behavior.8", 128,0);
macros("_bkmksbehav_sums") ;
}

_bkmksbehav_sums {
$_bkmksbehav_behavior = getpref(INT, "kmeleon.urlbar.default.behavior.8") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.7") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.6") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.5") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.4") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.3") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.2") ;
$_bkmksbehav_behavior = $_bkmksbehav_behavior + getpref(INT, "kmeleon.urlbar.default.behavior.1") ;
setpref(INT, "browser.urlbar.default.behavior", $_bkmksbehav_behavior) ;
}


_bkmksbehav_BuildMenu {
if ($kBookmarks) {
setmenu("&Bookmarks", popup, "URLBAR settings", -1);
setmenu("URLBAR settings", popup, "URLBAR match behavior", 0);
setmenu("URLBAR match behavior", macro, "Search anywhere", bkmksbehav_Search_anywhere, 0);
setmenu("URLBAR match behavior", macro, "Use word boundaries first", bkmksbehav_boundaries_first, 1);
setmenu("URLBAR match behavior", macro, "Use only word boundaries", bkmksbehav_only_boundaries, 2);
setmenu("URLBAR match behavior", macro, "Match only start of titles and URLs", bkmksbehav_only_start, 3);

setmenu("URLBAR settings", popup, "URLBAR default behavior", 1);
setmenu("URLBAR default behavior", macro, "Restrict: History", bkmksbehav_Restrict_History, 0);
setmenu("URLBAR default behavior", macro, "Restrict: Bookmarks", bkmksbehav_Restrict_Bookmarks, 1);
setmenu("URLBAR default behavior", macro, "Restrict: Tags", bkmksbehav_Restrict_Tags, 2);
setmenu("URLBAR default behavior", macro, "Match: Title", bkmksbehav_Match_Title, 3);
setmenu("URLBAR default behavior", macro, "Match: URL", bkmksbehav_Match_URL, 4);
setmenu("URLBAR default behavior", macro, "Restrict: Typed", bkmksbehav_Restrict_Typed, 5);
setmenu("URLBAR default behavior", macro, "Restrict: JavaScript", bkmksbehav_Restrict_JavaScript, 6);
setmenu("URLBAR default behavior", macro, "Restrict: Open Tabs", bkmksbehav_Restrict_Open_Tabs, 7);
}
}

# -----------------------------------------------------------------------------------
$OnInit=$OnInit."_bkmksbehav_BuildMenu;";
$macroModules=$macroModules . "bkmksbehav;";



Edited 1 time(s). Last edit at 11/19/2014 12:44AM by JamesD.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: siria
Date: November 23, 2014 09:47AM

Am wondering if those "behaviour" prefs really do work in KM?
That is, allow searching not only in history, but also in bookmarks?

Now I have some minor testing probs in 74 myself ;-P, but this page:
Quote
Mozilla
http://kb.mozillazine.org/Changing_autocomplete_behavior_-_Firefox

In Firefox 3 and above, when you start typing into the Location Bar, the autocomplete drop-down will show matching sites from your browsing history and bookmarks.

says the bookmark-search was already introduced in FF3, so it should work in KM1.6 (gecko FF3.5) already.
At least after adding pref "browser.urlbar.default.behavior"=0
But I cannot get any bookmark hits if not visited, no way.

Im km74 I only did a quick toggle test for the traditional KM settings in F2>Finding Websites, and they do toggle the same old prefs as KM1.6 (...urlbar.auto...)

Perhaps the urlbar system is different for KM and FF?
Perhaps a bookmark search not only requires more pref settings, but first need more code programming, and that's what Dorian implied there?

http://kmeleonbrowser.org/forum/read.php?4,130971
Quote
Dorian
This was planned but never done. Now this can only happen if kmeleon use FF bookmark system. I admit I'm barely using bookmarks myself ...


Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: adodupan
Date: November 23, 2014 12:21PM

siria, code for it is already there, but suggestions depend on places.sqlite file.
GUI for storing bookmarks in sqlite file should be copied from firefox\browser\omni.ja file.

A little help in your test, this will import your bookmarks in sqlite file:
copy this code

Components.utils.import('resource://gre/modules/FileUtils.jsm');
Components.utils.import('resource://gre/modules/BookmarkHTMLUtils.jsm');
BookmarkHTMLUtils.importFromFile(FileUtils.getFile('ProfD', ['bookmarks.html']), true);

open error console, paste code in text field and press enter.
Now you have your sqlite file and you can try your test again.

I expect your test report, also i would like to see Dorian's plan about km development, but it seems it is highly confidential smiling smiley

Regards

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: siria
Date: November 23, 2014 12:52PM

Ah, now I understand what you mean, autocomplete can only search inside 1 file!
So to search inside history AND bookmarks, it only works with the FF way to keep bookmarks AND history together in places.sqlite!

Hmm, frankly I don't like that too much sad smiley Prefer it clean, simple, and handy, not sure if that urlbar search is worth giving up the separate system, and not sure which disadvantages that may cost in return. So far the history worked well enough for my needs... But of course am aware 95% of users don't care what happens behind the scenes.

Couldn't there be a system that can search inside 2 files :cool:
Okay, probably too complicated.
Or perhaps a settings choice for the user, which system he prefers?

Options: ReplyQuote
 
Posted by: adodupan
Date: November 23, 2014 01:18PM

 



Edited 1 time(s). Last edit at 03/21/2016 12:05PM by adodupan.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: siria
Date: November 23, 2014 05:59PM

Always a matter of balance.
Having urlbar-autocomplete with bookmarks is a "good" change that I'd happily welcome, but having history and bookmarks (which have nothing to do with each other) mixed together inseparately in some big binary or whatever pot is a "bad" change. So in sum the good change comes at a bad price.
But of course the balance depends on the needs of each user.

But KM has always been famous that one can customize or fix or manipulate everything in simple text files, what I absolutely love, and use it often. The way FF is taking more and more drives people away again, claiming to make things more foolproof and at the same time removing customizing possibilities for users who are able to think a little bit with their own head. With such "highlights" like enforcing javascript on all except very experienced users by removing the switch from the visible settings sheets.
Not everyone likes such enforced rules, and if someone wants everything fully automatic without any need to think a thing himself, they will happily stay with FF anyway. There's no competition and never will be. And the others who turn away from FF and try KM may actually like the alternative KM ways better, the good-old-fashioned-ways, the easy and fully editable ways in openly readable text files, even if it requires a bit learning first. It's a special niche browser for special people :cool:

Also I'm hardly ever using bookmarks myself, and don't have any probs opening them the normal way or via nicks or shortcuts etc., so for ME there's no "good" change at all, sorry ;-)



Edited 1 time(s). Last edit at 11/23/2014 06:04PM by siria.

Options: ReplyQuote
 
Posted by: adodupan
Date: November 24, 2014 05:50AM

 



Edited 1 time(s). Last edit at 03/21/2016 12:04PM by adodupan.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: JamesD
Date: November 24, 2014 08:17PM

Quote
adodupan
Components.utils.import('resource://gre/modules/FileUtils.jsm');
Components.utils.import('resource://gre/modules/BookmarkHTMLUtils.jsm');
BookmarkHTMLUtils.importFromFile(FileUtils.getFile('ProfD', ['bookmarks.html']), true);

open error console, paste code in text field and press enter.
Now you have your sqlite file and you can try your test again.

Is there code to import IE Favorites into the database as bookmarks?

What would be the result if the code ( either favorites or our bookmarks) were run a second time? Would the database overwrite or duplicate?

What method could be used to run the code from a macro?

Options: ReplyQuote
 
Posted by: adodupan
Date: November 25, 2014 03:23AM

 



Edited 1 time(s). Last edit at 03/21/2016 12:04PM by adodupan.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: JamesD
Date: November 26, 2014 09:24PM

OK, I think I understand. I will just stick with Favorites and leave the bookmarks alone.

Options: ReplyQuote
Re: Location/adress Bar - Bookmark suggestion
Posted by: guenter
Date: November 29, 2014 09:18PM

Quote
adodupan
To import ie favorites you need ff\browser\omni.ja file.
With method above, bookmarks in sqlite file will be overwritten.
You can't run this code from a macro.

No. IE favorites import is offered by our bookmark's "Edit..." bottom left.

IE can import any bookmarks.html. So Windows hosts a toolchain to manage bookmarks.

You create a consistant up to date K-Meleon bookmarks.html and then use it to overwrite etc..

Else You create a consistant IE Favorites system to use it or import it.

Or import K-Meleon's bookmarks... Many streets lead to Rome.

You can IMHO do without that support from omni.ja.

p.s. Your code snippet to import K-Meleon bookmarks for our search is cool.
Will any along that line be incorporated into K-Meleon or be offered as an addon?

What Dorian plans is not all. He always accepted contributions. Any one that has finished work should offer it to him. In the past he usually accepted good things.

He implements the things he wants for himself - this does not exclude what we want. Or better what the ones capable to contribute would like.

Provided we/they create it. If it is something Dorian deems not needed.grinning smiley



Edited 1 time(s). Last edit at 11/29/2014 09:23PM by guenter.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.