General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
How to open images in the same window?
Posted by: Rain
Date: November 12, 2014 08:48PM

In K-Meleon, everytime you right-click an image and select "View Image" it automatically opens it in another window/new K-Meleon process, while in FireFox it opens it in the same window without making a new one. Is there a way to make K-Meleon behave like FireFox in this matter?

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: JamesD
Date: November 12, 2014 10:03PM

I think this will do it. Create this macro. Put it in macros or user macros folder and restart KM. There should be a new item named "Open Internal" in I&mages.

Image_in.kmm

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

# 				Image_in.kmm
#
# Dependencies	: main.kmm 
# Resources	: -
# Preferences	: 
# Version	: 0.1   2014_11_12
# Author	: JamesD 
# -----------------------------------------------------------------------------------

Image_in_RunCode {
macroinfo = _("Open the image in this window.");
open($ImageURL);
}

_Image_in_BuildMenu {
setmenu("I&mage", macro, "Open Internal", Image_in_RunCode, -1);
}

# -----------------------------------------------------------------------------------
$OnInit=$OnInit."_Image_in_BuildMenu;";
$macroModules=$macroModules . "Image_in;";


Options: ReplyQuote
Re: How to open images in the same window?
Posted by: Rain
Date: November 13, 2014 07:16PM

Sorry James but i'm terrebly new at this. How exactly do i do that? Create a .txt document copy and paste the code that you wrote above in it and then change it's extension to .kmm?

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: JamesD
Date: November 13, 2014 08:07PM

@ Rain

Pretty much like you wrote, but with some more complexities.

You should create a text file and copy and paste the code in my post into it. The code part begins with the line:
# K-Meleon Macros (http://kmeleon. . ....
and continues to include the line:
$macroModules=$macroModules . "Image_in;";

The file when saved should be named Image_in.kmm

Notepad likes to put the extension txt so you need to select all files when saving or change Image_in.kmm.txt to be Image_in.kmm later.

Then you need to decide which of two possible locations to put the file. If you have write access to your K-Meleon root folder, you may place the file in the macros folder which is under the root.

If you do not have write access to the KM root folder then you will need to place the file in your profile. The easy way to find your current profile is to run KM and do EDIT - CONFIGURATION - PROFILE DIRECTORY. If this is the first macro you adding to your profile then the folder macros will not exist. Create a folder with that name and copy the Image_in.kmm file to it. Then close the edit window.

Note that if you run multiple profiles, the first method is preferable. If you can't do that one, then you will need to add the macro to each profile.

No matter which method, you will need to restart KM for the file to be read.

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: siria
Date: November 13, 2014 08:08PM

Exactly smiling smiley
Preferably with encoding UTF-8, but in this case it probably doesn't matter since there are no special characters in it.

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: Rain
Date: November 14, 2014 08:33PM

Well, i did it but unfortunatelly it does not seem to work. When opening images it keeps opening them in a new window instead of opening them in the same and/or new tap instead of a new window.

Here's the file in case you're wondering if i did it correctly.

http://www.filedropper.com/imagein

I'm the sole user of this computer and have administrative rights i don't user more then one profile.

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: siria
Date: November 14, 2014 08:49PM

Quote
JamesD
There should be a new item named "Open Internal" in Images.

My first thought: perhaps you clicked the native command again instead of the new one...?

Quote
Rain
in a new window instead of opening them in the same and/or new tab
What do you prefer, same tab or new tab?



Edited 1 time(s). Last edit at 11/14/2014 08:52PM by siria.

Options: ReplyQuote
 
Posted by: adodupan
Date: November 14, 2014 09:02PM

 



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

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: JamesD
Date: November 14, 2014 09:29PM

Did you get the correct item in the menu? ( New item is at bottom of menu)



This is my results.



In this case I had only one window with only a single tab in it. The image loaded in the same place as the forum thread.

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: Rain
Date: November 15, 2014 09:10AM

Quote
siria
What do you prefer, same tab or new tab?

Preferably the same tab, but as long as it's not opening a new window a new tab works just fine.

Quote
JamesD
Did you get the correct item in the menu? ( New item is at bottom of menu)

Okay James, i'm sorry, i'm an idiot, it worked! I just WRONGFULLY assumed it would work if i click "View Image" instead.

Thanks for both of your help.



Edited 1 time(s). Last edit at 11/15/2014 09:13AM by Rain.

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: JamesD
Date: November 15, 2014 12:48PM

@ Rain

I should have fixed the position but I was in too much of a hurry.

Change one item in this line of code to move the position to the top of the menu.

setmenu("I&mage", macro, "Open Internal", Image_in_RunCode, "ImageView");

Also, if you prefer different wording for the menu item, that is in the same line.

Options: ReplyQuote
Re: How to open images in the same window?
Posted by: Rain
Date: November 15, 2014 03:33PM

@ JamesD

No worries, it works flawlessly now, thank you!

Options: ReplyQuote


K-Meleon forum is powered by Phorum.