Bugs :  K-Meleon Web Browser Forum
You can talk about issues with k-meleon here.  
Two problems concerning new tabs
Posted by: foliator
Date: August 07, 2015 08:29PM

Greetings, K-Meleonaires! grinning smiley Has anyone else experienced the following two problems? I'm not sure whether they only occur on my system (Win7 x86), or are actually bugs.
  1. In both KM74 and KM75 this behavior affects all websites, as well as local pages on my hard drive:
    A link designed to open a new tab will disable the up and down arrow keys in the new tab, even after the page has finished loading and I've clicked a blank area of the page. I then can't scroll up and down unless I use the mouse wheel (a touchpad gesture in my case) or drag the scroll bar handle. As a workaround, I can unblock the arrow keys by focusing the URL bar (F6 or Alt D), then hitting TAB to put the focus back on the page, but this has to be done each time a link opens a new tab. On the other hand, if the link is designed to open in the same tab and I use Ctrl Click to open it in a new one, everything is normal and the arrow keys work.
  2. This seems to be something new in KM75: Pressing Ctrl Enter in the URL bar no longer opens a typed URL in a new tab.



Edited 2 time(s). Last edit at 08/07/2015 08:33PM by foliator.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: JamesD
Date: August 08, 2015 02:31PM

I am unable to confirm. I typed "applehouse" in the URLBAR and used CTRL+ENTER and the applehouse page opened in a new tab for me.

When you say "a link designed to open in a new tab" do you mean the link opens in a new tab by just clicking on the link, or do you mean that you right click and open the link in a new tab? I have not found a page where opening in a new tab by right click menu where the down arrow did not scroll the page.

Do you use window diversion in preferences? Mine is still set to open new window in new window. I have not tried the diversion.

I have tried in KM 75.0 and 75.1 on Win 7 (32 bit).

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 08, 2015 04:23PM

What I meant was that a link in some pages is supposed to open in a new tab just by clicking it without Ctrl. In basic HTML this is usually done by adding the following string to the HREF tag:

target="_blank"

Sometimes, instead of using my bookmarks, I use a local page of links as my homepage. This I keep open while following the links in new tabs. Ctrl Click always works, but yesterday I tried adding that "target" string to each link so I wouldn't need the Ctrl key. That's when I discovered the problem.

I suppose some sites do it with JavaScript, but I don't know anything about JS.

As for diversions, I've set all pages to open in tabs instead of windows, because despite popup blockers and the like, I've run into sites where new unwanted windows open in the background. My taskbar is always auto-hidden to save vertical space, so I don't always know what's going on down there. Actually, K-Meleon opens new windows for some internal functions regardless of my settings; View Image in the context menu is one example.

Anyway, the problem never existed in Firefox 15, which also let me open typed URLs in new tabs (in FF it's Alt Enter). Maybe the newer version of the Gecko engine is to blame and I'd experience the same thing in more recent FF releases, but I don't like FF enough to install it.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 08, 2015 04:58PM

An update: I just discovered that if I set new tabs to open in the background, the arrow keys are not disabled, so I restored my original setting to open tabs in the foreground, and they disabled the arrow keys again. What this tells me is that the arrow keys only work correctly if I have to switch to the new tab manually.

With this in mind, I've found that to free up the arrow keys, I can also switch back and forth between the tabs (by Ctrl Tab or by clicking on the tabs). This is just as much of a nuisance as focusing back and forth between the URL bar and the page content.

Still can't get Ctrl Enter to work in the URL bar.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 08, 2015 07:19PM

1. Up&Down Arrow problem.

Fully confirm in all KM builds from at least 74 release.

Diverted pages opened in foreground can't use keyboard arrows scroll.
The only solution is the same as for sourcecode window - switch to another tab, then switch back to the diverted and click on the page 'canvas' to get focus.

It's all the same old problem of assigning focus to the page, which appears in very first builds of KM74 and was solved only partly.

2. Opening from URLbar in new tab.

Cannot confirm. New tab is created and address is transferred there but the side effect is defined by the default Ctrl+Enter function of Manual Domain Completion.





Edited 1 time(s). Last edit at 08/08/2015 07:19PM by rodocop.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 08, 2015 07:21PM

foliator,

you should open ticket on bugtracker about the focus, I think.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 08, 2015 07:40PM

Quote
foliator
An update: I just discovered that if I set new tabs to open in the background, the arrow keys are not disabled, so I restored my original setting to open tabs in the foreground, and they disabled the arrow keys again.

Sounds like a real bug to me => a job for Dorian.
Meanwhile, since it bugs you, we could perhaps try some workaround macro, if you like. E.g. setting an OnLoad function that kicks in whenever a page finished loading, then KM can automatically flip a tab back+forth. The flicker would probably happen nearly invisible. But no idea if flipping alone would be enough - cannot simulate "clicking inside page" to focus.

Quote
foliator
Actually, K-Meleon opens new windows for some internal functions regardless of my settings; View Image in the context menu is one example.

Oh yes, that's a major nuisance for me too, so am using a minimacro since ages to fix that. There sure are cases when opening a new window makes sense, e.g. for xul-windows like Preferences. And am not sure if there's still that old 1.6 bug that xul-windows resize the whole window with all tabs unvoluntarily or not.
But opening simple pages like docinfo-links and especially single images in new windows doesn't make any sense to me. Probably just a relic from ancient pre-tab times :cool:
Could throw that image-tab-function into your workaround-macro as well.
If you're really strict about as many tabs as possible, you could even edit main.kmm and look for "opennew" and "InNewWindow" and change some of those too, after considering for each command if you really prefer a tab for it or not. And of course after first making a backup copy ;-)

Quote
foliator
Still can't get Ctrl Enter to work in the URL bar.

Did some research, and like rodocop too found that this shortcut was never intended to do that: instead it shall add "www" and "com" around the urlbar contents, then open it like normal "typed urls"!
Preferences (F2) > Browsing > Finding Websites
The shortcut is defined in domcomplete.kmm
What is your default setting for "Typed URLs"? Is it different from previous installs/profiles?
Or do you want to open those by default in the current page, and only with that shortcut in a new page?
If so, you could customize your user accels (profile folder) to use another little minimacro instead of autocomplete.
All that (tiny) workaround stuff can be thrown together in a single kmm-file, which doesn't change a thing in profile or KM settings, and only has any effect while it exists in the macros folder. Except for defining the command for that accel, if it's not changed in profile accels.cfg but in the macro directly, there's a 50/50 chance that it could be ignored.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 08, 2015 07:52PM

siria,
don't hide the macro from foliator! Show him the ImageTab to View Image in tab not in window.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 08, 2015 08:34PM

Well, you have the full overview over all sorts of macros - I only know those in my personal KM macros folder grinning smiley

Just hope some day Dorian may consider adding this 1-liner finally into the box too.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 08, 2015 08:46PM

Quote
siria
Quote
foliator
An update: I just discovered that if I set new tabs to open in the background, the arrow keys are not disabled, so I restored my original setting to open tabs in the foreground, and they disabled the arrow keys again.

Quote
siria
Sounds like a real bug to me => a job for Dorian.

Well, now that I've seen the scrolling issue described in rodocop's post as a known bug, there's little point in submitting another bug report.

Quote
siria
Meanwhile, since it bugs you, we could perhaps try some workaround macro, if you like. E.g. setting an OnLoad function that kicks in whenever a page finished loading, then KM can automatically flip a tab back+forth. The flicker would probably happen nearly invisible. But no idea if flipping alone would be enough - cannot simulate "clicking inside page" to focus.

The problem there is that there may be more than one other tab open, so the macro would have to know where to flip, and how many of the flippin' things there are. smiling smiley Ctrl Tab, for instance, switches to each tab in succession. If there happen to be, say, five of them, that could be problematic.

Quote
foliator
Actually, K-Meleon opens new windows for some internal functions regardless of my settings; View Image in the context menu is one example.

Oh yes, that's a major nuisance for me too, so am using a minimacro since ages to fix that. There sure are cases when opening a new window makes sense, e.g. for xul-windows like Preferences. And am not sure if there's still that old 1.6 bug that xul-windows resize the whole window with all tabs unvoluntarily or not.
But opening simple pages like docinfo-links and especially single images in new windows doesn't make any sense to me. Probably just a relic from ancient pre-tab times :cool:
Could throw that image-tab-function into your workaround-macro as well.
If you're really strict about as many tabs as possible, you could even edit main.kmm and look for "opennew" and "InNewWindow" and change some of those too, after considering for each command if you really prefer a tab for it or not. And of course after first making a backup copy ;-)

Don't worry, I have a complete backup of my entire KM application folder (I'm using the portable version) on an external hard drive. I only update the backup files if I've made some changes and there were no adverse effects. I had a look at main.kmm, but found no specific reference to View Image, which is the only thing I'd change, anyway.

Quote
foliator
Still can't get Ctrl Enter to work in the URL bar.

Quote
siria
Did some research, and like rodocop too found that this shortcut was never intended to do that: instead it shall add "www" and "com" around the urlbar contents, then open it like normal "typed urls"!
Preferences (F2) > Browsing > Finding Websites
The shortcut is defined in domcomplete.kmm

Good research! I have always left the autocomplete options unchecked, as I don't want them. This applies even in KM74, but there Ctrl Enter did what I asked. I think, however, that it must be precisely the autocomplete feature that prevents Ctrl Enter from working in KM75. In the meantime, before I came back to this thread just now, I did some research of my own, found the internal command that opens typed URLs in new tabs, and added the following to my accel.cfg, coincidentally anticipating your solution ;-) :

CTRL VK_RETURN = macros(Go_New)

Now at least that works! Long live user customizable keyboard shortcuts! smiling smiley



Edited 1 time(s). Last edit at 08/08/2015 08:49PM by foliator.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 08, 2015 08:55PM

Quote
rodocop
1. Up&Down Arrow problem.

Fully confirm in all KM builds from at least 74 release.

Diverted pages opened in foreground can't use keyboard arrows scroll.
The only solution is the same as for sourcecode window - switch to another tab, then switch back to the diverted and click on the page 'canvas' to get focus.

It's all the same old problem of assigning focus to the page, which appears in very first builds of KM74 and was solved only partly.

Thanks, rodocop. At least now I know that it isn't just on my end.

Quote
rodocop
2. Opening from URLbar in new tab.

Cannot confirm. New tab is created and address is transferred there but the side effect is defined by the default Ctrl+Enter function of Manual Domain Completion.

Which I never use, and those options are all unchecked in Preferences, but you'll see my workaround in my reply to siria above.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 08, 2015 09:00PM

Just installed ImageTab, rodocop, and it works just fine!

Great little macro, siria! I think I'll try hiding the original View Image from the context menu.



Edited 1 time(s). Last edit at 08/08/2015 09:01PM by foliator.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 08, 2015 09:27PM

Cool, you found it yourself smiling smiley

Guess this version of imagetab wasn't by me really, but "opentab($ImageURL)" is a rather universal code grinning smiley

About the flippin' thing, no prob, the number of open tabs is known too but not necessary at all: there exists a flip-BACK command too (Ctrl Shift Tab). Perhaps just try? (usual procedure, copy into editor, save as workaround_FlipFocus.kmm in macros folder, restart)

# http://kmeleonbrowser.org/forum/read.php?3,134771
# Workaround for bug in KM74/75 : When a link wants to open a new window and is redirected to open a new TAB instead, and it's opened in foreground, then the page isn't in focus and keyboard arrow keys cannot scroll. This macro adds a tab-flicker after EVERY page load, cannot restrict it to those cases only.

workaround_FlipFocus{
id(ID_TAB_PREV);
id(ID_TAB_NEXT);
}
$OnLoad=$OnLoad."workaround_FlipFocus;";

$macroModules=$macroModules."workaround_FlipFocus;";




Edited 1 time(s). Last edit at 08/08/2015 09:28PM by siria.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 08, 2015 09:55PM

Yes, your flippin' macro does work. grinning smiley Another fine macro by siria! This, too, should be included in KM's download package.

Wow, that's three major improvements in a single day! Wish I could do that with my guitar-playing technique, but no one could ever write a macro for that. tongue sticking out smiley

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 09, 2015 02:17AM

siria, wouldn't it be better to change event from
OnLoad
to
OnOpenTab
?

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 09, 2015 03:55AM

This flip could be changed by single
id(ID_SELECT_URL);

as you need click on page anyway to keyboard arrows scroll to work.

I tried find a way to emulate pressing with JS but all I found didn't work inside macro (and may be - at all).
Also I found that JS has a command to force give a focus to window, but I can't use it as my JS-skills are zero-sized...



Edited 4 time(s). Last edit at 08/09/2015 04:08AM by rodocop.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 09, 2015 06:20AM

Whatever works best for you smiling smiley
Of course I can only test offline on Vista, by opening local file-pages. No https etc.
But there it seems to work fine with the first version, without needing to manually focus the page again. Now tried with $OnOpenTab - but this needs another focus-click.

What I'm not happy with is that this is fired each and every single time a page is loaded, whether it's needed or not sad smiley
Have now tested with at least a check for the 2 prefs involved (open diverted in foreground, open as tab). This check can be done either only 1x at startup, or at every page load again, and again, and again...
No idea at all if all that checking is really that much better than flipping away, regardless of prefs. Which method may need more or less ressources...

Also tried with the new command versions that Dorian prefers, without "ID_", it seems to work same as old commands.

But now noticed something that's very curious:
even this workaround only works if the new tab is opened right "next to the current tab"! Not "next to last tab", when there are other tabs in between.

The only trick is to switch back to the CALLING tab, by macro or manually, all other tabs do nothing!
Well, at least they reduce the nuisance to only 1 click into the page.

That means I could only make the workaround-macro flip through ALL tabs, don't know how to figure out the calling tab...



Edited 2 time(s). Last edit at 08/09/2015 11:10AM by siria.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 09, 2015 11:04AM

This is getting real overkill, but don't know a better way :-/

Modified the macro to check only at startup which user prefs are set, then decide what shall be done after EACH page load (nothing / flip 1x / flip all)
(but have NOT tested exactly this complete macro on my other machine yet, only single parts of it)

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#
# ---------------------- workaround_FlipFocus.kmm ----------------------
# Version : v2 / 2015-08-09 / by siria
# Forum: http://kmeleonbrowser.org/forum/read.php?3,134771
# K-Meleon version: KM 74/75.0 (newer unknown)
# -------------------------------------------------------------------------------------------
# THIS bug-workaround macro is ONLY FOR PEOPLE WHO SCROLL BY KEYBOARD
# AND FORCE new-window-LINKS into new TABS!

# -------------------------------------------------------------------------------------------
# Prob: such pages aren't in focus and keyboard arrow keys cannot scroll.
# This macro adds a tab-flicker after EVERY page load, cannot restrict it to necessary cases only :-(
#
# At Browser START check User-Preferences if:
# 1) links for new WINDOWS shall open as new TABS (diversion) (=3)
# 2) if they shall open in foreground
# 3) if new tabs shall open NEXT to the calling tab (=1) or as LAST tab (=0)
# if 1+2 true, focus needs one of those tab-flipping workarounds:
# if 3=next, flip prev-next / if 3=last, flip ALL to include the CALLING tab
#
# TIP: if you're opening new tabs as "last" tab and prefer to click into such pages only when necessary, instead of flipping through ALL pages after EVERY page load, disable the line after ***USERCONFIG***

_workaround_FlipFocus_startup{
if (getpref(INT,"browser.link.open_newwindow")==3)
if (getpref(BOOL,"browser.tabs.loadDivertedInBackground")==false) {
$OnLoad=$OnLoad."_workaround_FlipFocus1;";
#
if (getpref(INT,"kmeleon.tabs.onOpenOption")==0)
# *** USERCONFIG *** disable next line with # if you rather click into such pages:
$OnLoad=sub("_FlipFocus1","_FlipFocusALL",$OnLoad);

}}

_workaround_FlipFocus1{
id(ID_TAB_PREV);
id(ID_TAB_NEXT);
}

_workaround_FlipFocusALL{
$_tabnr=$TabNumber;
while ($_tabnr>0) macros(_workaround_FlipFocus_loop);
}
_workaround_FlipFocus_loop{
$_tabnr=$_tabnr-1;
id(ID_TAB_PREV);
}

#-----------------------------
$OnStartup=$OnStartup."_workaround_FlipFocus_startup;";
$macroModules=$macroModules."workaround_FlipFocus;";


(updated again, now rather version-2c)



Edited 4 time(s). Last edit at 08/09/2015 11:26AM by siria.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 09, 2015 07:10PM

siria, what I've done is to set my new tabs to always open next to the calling tab, which alleviated any problems with your first version of the macro. When the new tab followed some existing tabs, the macro still seemed to work, but a click on the new tab's content was still necessary to free up the arrow keys.

Unfortunately my partner can't get this macro to work on his machine, regardless of the new tab settings. His machine also runs Win7, although it's the Home Premium 64-bit Edition, and the computer has a dual-core processor, more speed and lots more RAM, if that's significant. Mine is running Win7 Starter, x86, and has a single-core processor with two threads (system info shows this as two logical processors).

I thought maybe his machine runs so much faster than mine that the tab switching is somehow skipped over, since it's not even noticeable on mine. What I tried was to copy the two commands in your macro and paste them directly after the originals so as to force the switching to be performed twice. That didn't help. Even running the command three times made no difference, so I'm not sure if it ran at all.

Maybe the macro doesn't work in KM74, because he's still using that version. I set it up for him, since he has no interest in the technical side of computers, and I don't want to cause a disruption by updating his installation. When I updated mine to KM75 I spent a lot of time making changes. He has no other problems with KM74, anyway, and is not nearly as fussy as I am. grinning smiley

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 09, 2015 07:17PM

@siria:
I've changed the internal name of your ImageTab macro to "View Image" (removed ":Tab") and hidden the original View Image from the context menu. Now the context menu shows "View Image" as before, but it's actually your macro in disguise. :cool:

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 09, 2015 07:37PM

imagetab isn't "my" macro, sorry ;-)

Anyway, the other macro has exactly the same effects as manual actions. If you manually switch tabs on his machine, does that help?
If yes, there might be some prob with the macro that can probably be fixed...

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 09, 2015 08:20PM

Quote
siria
The other macro has exactly the same effects as manual actions. If you manually switch tabs on his machine, does that help?
If yes, there might be some prob with the macro that can probably be fixed...
Yes, he can always switch tabs manually, which frees up the arrow keys, although he usually frees them up by pressing F6 followed by the Tab key to go in and out of the URL bar. If manual switching weren't possible, that would present a far more serious problem. :O

I'll try out your revised macro, first on my machine then on his, and let you know what happens.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 09, 2015 09:25PM

Quote
Dorian
KM75.1_beta1_Update 4
- Fix cfg macro
- Fix position of bookmark image in menu
- Fix focus on new tab (the hints helped me)
- Tweaked image a bit (may broke/fix do nothing on w2k)

Wow, kinda great, fixed right away with teamwork grinning smiley



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

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: foliator
Date: August 09, 2015 11:15PM

@siria:

Quote
foliator
I'll try out your revised macro, first on my machine then on his, and let you know what happens.

It still didn't work, but he says he's not too concerned about it, because he can just keep doing what he's been doing all along.

On my machine, I tried setting the new tabs to open next to the last one; Macro 2 worked a bit better than Macro 1, in that I didn't have to click on the pages. If I accumulated too many tabs, however, I finally had to do that, but by then there were more tabs open than I would ever care to use. Five is as far as I usually go.

Glad to see that Dorian just updated beta 1 with a fix for this problem. It will help other users, especially newcomers. To leave well enough alone, however, I think I'll stay with the stable release of KM75, as it seems to be behaving itself now. ;-)

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 10, 2015 01:33AM

foliator,
and what about update4? Should work I think!

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 10, 2015 10:02AM

@foliator, you're right about KM74 - and am slightly shocked now :O
After remembering that my offline machine still has a 74 installation too, did some tests myself, and couldn't believe it: the macro-bugs are even far worse than just this, many not only affecting diverted windows or keyboard scrolling, but perfectly normal tabs too!

Looks like in KM74 $OnLoad never executes even some basic macro-commands like switching tabs, windows, highlighting URL, toggling statusbar etc., regardless whether a page is fully focussed or not.

Restricted to diverted windows again there's a real funny behaviour, selecting whole page content seems to work - but the highlight color isn't blue, but gray, so the new tab is partly focussed and partly still the calling tab.

Never had heard of such basic macro-probs, being unable to use 74 myself for internet. Couldn't remember if advanced commands like the injectJS-return bug was already fixed in 74, but certainly thought that such easy, classic commands all worked.
Considering 74 is the last version that runs on Win2000 and XP-SP2 without needing expert tricks, that's rather bad news for macros sad smiley

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: rodocop
Date: August 10, 2015 12:08PM

Focus problem of 74 was actively discussed that time.

And it seemed for me that 'grey selection prob' was solved in 74 release.

But now I see that it exists at least for diverted windows like you say.

Maybe Dorian would create a little 74-update only for this feature as he found the solution now?

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: siria
Date: August 10, 2015 08:32PM

Yes I dimly remember focus bugs in beta versions, but had the impression they had been fully or nearly fully fixed until the stable version.

But regardless, that $OnLoad bug is another issue, and can't remember having heard of that one before: That some classic macro commands just never work OnLoad, on ALL pages, on fully focussed pages, while manually they still work normal: if called by shortcuts, menus or macros. Just not "OnLoad".

Of course there's a possiblity that the same reason that causes the focus probs may also have some influence on OnLoad and other functions, but if OnLoad-bugs affect ALL pages, there's no obvious connection.

Options: ReplyQuote
Re: Two problems concerning new tabs
Posted by: JamesD
Date: August 10, 2015 11:58PM

Does anyone know which macro command is not working with OnLoad? I would like to do some testing, but I am not sure what situation I should test.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.