Tabs behavior - looking for a couple of options for efficiency of work

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
MrAccident
Apollo supporter
Apollo supporter
Posts: 44
Joined: 2017-11-19, 19:34

Tabs behavior - looking for a couple of options for efficiency of work

Unread post by MrAccident » 2021-05-05, 21:01

I had 2 Extensions for the following behaviors: closing the tab - with middle-mouse click anywhere within a webpage (not on a link); switching to the left|right tab with keys “1” and “2” (can be something similar, with one key). These are what I miss the most in the daily work-flow with tabs, since the extensions became inactive.
So I don't know where this belongs: feature suggestion, extensions, how to... Do you know of any way to get these behaviors? For instance - I have the extension "Dorando keyconfig". I didn't find these options there.
P.S. - there is the Extension - “Tab Kit - Mouse Gestures”, with which you can use a Mouse button + Scroll-Wheel ― but this is hardly more convenient, and the whole text on the page becomes selected.

[PCMartin]

Re: Tabs behavior - looking for a couple of options for efficiency of work

Unread post by [PCMartin] » 2021-05-08, 06:08

MrAccident wrote:
2021-05-05, 21:01
  • closing the tab - with middle-mouse click anywhere within a webpage (not on a link)
  • switching to the left|right tab with keys “1” and “2”
First, it might be easier to just try hacking your two extensions by installing a Pale Moon compatibility block into their respective install.rdf files.

If that doesn't work, I have a possible alternative solution. I don't know how helpful it will be, especially if you don't use Windows and aren't interested in learning a little about AutoHotkey (a scripting program for Windows that I'm not remotely good at). Starting with your second goal:

I have made a simple AutoHotkey script that remaps one key to switch to the tab on the left, another key to switch to the tab on the right, and another key to close the current tab:

Code: Select all

#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 2
; Custom Tab Navigation
#IfWinActive, ahk_class Chrome_WidgetWin_1
PgUp::^PgUp
PgDn::^PgDn
Pause::^w
#IfWinActive, ahk_class MozillaWindowClass
PgUp::^PgUp
PgDn::^PgDn
Pause::^w
#IfWinActive, ahk_class Notepad++
PgUp::^PgUp
PgDn::^PgDn
Pause::^w
(I've attached the original file for your convenience. You will almost certainly want to edit it, in a text editor, before using it. Delete the ".txt" at the end of the filename before loading it.)

It's currently set up to work in Chrome-family browsers, Mozilla-family browsers (including Pale Moon), and Notepad++. (In Brave, which uses the same Window class and same shortcut-key combos as Chrome, the switch-to-right-tab key toggles back and forth between right and left tabs instead of continuing to navigate right, for reasons I have yet to figure out. The script works as intended in the other apps, including Pale Moon.)

The shortcut keys I used (PgUp, PgDn, and Pause, on the left side of the double colons) were chosen based on my laptop's particular keyboard layout. (I've remapped those keys' original functions to more convenient locations.) You will almost certainly want to use different shortcut keys than I have. To do this, refer to AutoHotkey's List of Keys.

If you don't want a "Close Tab" key, or don't want the script to work in some of the targeted applications, just comment out the relevant lines by typing "; " (semicolon space without the quotes) at the beginning of each line. (And then save the file, obviously.)

To use your edited script, install AutoHotkey and double-click on the script file. To exit the script, right-click on its icon in the Notification Area / System Tray and choose Exit. To start it automatically whenever you sign into Windows, put a shortcut to the script file in your Startup folder.

As for your first goal, If you install the Tax Mix Plus extension and go into Tab Mix Plus Options > Menu tab > Main Context Menu subtab, you'll see an option to show a "Close Tab" command in the main context menu (the right-click menu you see when you're in Pale Moon's page-content window). If you enable that option and "Close Tab" doesn't show up when you right-click on a link (which you don't want, right?), you might be in business, because I think it should be possible to use AutoHotkey to remap a mouse middle-click to do right-click > Close Tab. You can see how to remap the mouse at AutoHotkey's documentation on Remapping Keys (Keyboard, Mouse and Joystick). Sorry, but I don't think I have a good example of that kind of remapping to provide you. You might find one by doing a little searching on the Web. CAVEAT: If you use other apps that have MozillaWindowClass windows, you might have to find a way to restrict the middle-click script or code to Pale Moon exclusively.

Honestly, I hope someone else steps forward with a much simpler solution. If those two extensions worked in Pale Moon 29.1.1, I still think a compatibility hack is your best bet.
Attachments
CustomTabNavigation.ahk.txt
(341 Bytes) Downloaded 6 times

MrAccident
Apollo supporter
Apollo supporter
Posts: 44
Joined: 2017-11-19, 19:34

Unread post by MrAccident » 2021-05-12, 03:31

@[PCMartin] - I'm on FossaPup; so I can't use this program. But I'll ask in their forum.
Thanks.

Locked