General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Open local HTML files in same window?
Posted by: playwin2
Date: October 07, 2008 07:43AM

Hello,

How should I open local html files (i.e. files on HDD), in the same window?

Presently k-meleon opens a new window for each files I double click in windows Explorer, I wish to have only a single window with tabs for each files...

Thanks for any help...

Options: ReplyQuote
Re: Open local HTML files in same window?
Posted by: JamesD
Date: October 07, 2008 07:46PM

@ playwin2

Perhaps this macro will be of use. The files I store locally have the extension of htm so that is what I used. The menu item will appear in the View menu. If most of your files are in same folder, you will not have to re-enter folder each time. The macro remembers previous used.

GoLocals.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- GoLocals.kmm
# ---------- K-Meleon Macro Language Open local files in current browser ---------------
#
# Dependencies       : -  main.kmm 
# Resources           : -  
# Preferences         : - "k-meleon.view.local.folder"
# Version               :  -  0.3   2008-10-07
# --------------------------------------------------------------------------------

_GoLocals_RunCode{
macroinfo = "Open locally stored pages" ;
$_GoLocals_Folder_Retained = getpref(STRING, "k-meleon.view.local.folder");
$_GoLocals_RLen = length($_GoLocals_Folder_Retained);
$_GoLocals_RLen > 0 ? &_GoLocals_Ask_Same : &_GoLocals_New_Folder ;
}

_GoLocals_Ask_Same{
$_GoLocals_Folder_Confirm = confirm($_GoLocals_Folder_Retained, "Use this folder?", YESNO, QUESTION) ; 
$_GoLocals_Folder_Confirm == "YES" ? &_GoLocals_Same_Folder : &_GoLocals_New_Folder ;
}

_GoLocals_Same_Folder{
$_GoLocals_Folder = $_GoLocals_Folder_Retained ;
$_GoLocals_File = promptforfile($_GoLocals_Folder, "HTML docs", "*.htm") ;
open($_GoLocals_File) ;
}

_GoLocals_New_Folder{
$_GoLocals_Folder = promptforfolder("Select folder containing local files");
setpref(STRING, "k-meleon.view.local.folder",$_GoLocals_Folder);
$_GoLocals_File = promptforfile($_GoLocals_Folder, "HTML docs", "*.htm") ;
open($_GoLocals_File) ;
}

_GoLocals_ModMenu{
## show in View menu ;
setmenu("&View",separator, -1);
setmenu("&View",macro,"Local Pages",_GoLocals_RunCode);
}

$OnInit=$OnInit."_GoLocals_ModMenu;";
$macroModules=$macroModules."GoLocals;";


Options: ReplyQuote
Re: Open local HTML files in same window?
Posted by: kko
Date: October 07, 2008 08:06PM

Open Edit > Preferences, under Category Browsing go to the tab Window Diversion. In the drop-down list (Open ...), select "URLs passed from external applications" and then choose to open such links in a new tab instead of a new window.

Options: ReplyQuote
Re: Open local HTML files in same window?
Posted by: playwin2
Date: October 08, 2008 08:06AM

Hello kko,

Thanks, now it's working as expected. smiling smiley
Much appreciated. grinning smiley

@JamesD
Thanks, as you can see I'm new to KM, and hence don't understand those macros till, but will try that, just to learn macros. smiling smiley



Edited 1 time(s). Last edit at 10/08/2008 08:07AM by playwin2.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.