MoonGestures release

Add-ons for Pale Moon and other UXP Applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

Post Reply
astewart
Apollo supporter
Apollo supporter
Posts: 45
Joined: 2013-12-19, 02:34
Location: San Diego, CA, US

MoonGestures release

Post by astewart » 2021-05-12, 00:05

I'm happy to see MoonGestures released, but being based on the latest version of FireGestures, it carries over a bug running on Pale Moon. There isn't a support link on the addon page, so I'll put it here.

In the file browser.js line 37:

Code: Select all

this._statusTextField = gBrowser.getStatusPanel();
generates an error "gBrowser.getStatusPanel() is not a function".

Looking back a few versions at the Firegestures code, this used to be:

Code: Select all

		this._statusTextField = document.getElementById("statusbar-display");
		if (!this._statusTextField)
			this._statusTextField = gBrowser.getStatusPanel();
which works correctly. Only the first of the 3 lines is needed for Pale Moon.

The default configuration for MoonGestures, in the options dialog, shows "Hide status display after" is set to zero, which disables the option. The value spinner cannot be used to set a non-zero value. Instead, using about:config to set "extensions.firegestures.status_display" to some value like 2000 ( 2 seconds) enables the dialog option.

If the timeout is set to non-zero and the code fix above is not made, the status display will fail. Otherwise, the status bar will briefly show the gesture made. It also shows "Unknown" when a gesture is not recognized, which is more useful.

Alan

dragon_fly
Moongazer
Moongazer
Posts: 11
Joined: 2017-10-13, 22:12

Re: MoonGestures release

Post by dragon_fly » 2021-05-12, 23:08

Hi!

I forked this add-on, and was about to open the topic about it ("it" == add-on, not my forking efforts) tonight, but you beat me to it :lol:

I knew about this bug. When the "Status display" option is active, the add-on is working as usual, but every gesture with RMB opens the context menu.
I tried to tinker with this but it didn't occur to me to check the previous versions, and my skills weren't enough to fix it. That is why I intentionally deactivated this option and set the timeout to zero.
The code was left there.

I wanted to ask for help, but if you already found the solution then it's even better.
The lines 2 and 3 may actually be needed for Basilisk.
I'll reupload the add-on tomorrow (probably).

astewart
Apollo supporter
Apollo supporter
Posts: 45
Joined: 2013-12-19, 02:34
Location: San Diego, CA, US

Re: MoonGestures release

Post by astewart » 2021-05-13, 06:25

dragon_fly wrote:
2021-05-12, 23:08
I tried to tinker with this but it didn't occur to me to check the previous versions
You'd have to go back to version 1.10.1. I've been carrying that code forward since then and forgot I did it.
The lines 2 and 3 may actually be needed for Basilisk.
Yes, I hadn't observed that you have Basilisk as a target. Those two lines do make it work there.

I have two other bugs for you. When you have some hosts in the block list, gestures are also blocked for local files with no host in the url. In browser.js, CanStartGesture(), the block check is

Code: Select all

	if (this._blockedHosts.some(host => gBrowser.currentURI.asciiHost.endsWith(host))) {
		dump("*** suppress starting gesture on blocked host\n");	// #debug
		return false;
	}
For local files, asciiHost fails and the function returns null. I added

Code: Select all

        var hasAsciiHost = true;
        try {
            var host = gBrowser.currentURI.asciiHost;
        }
        catch(e) {
            hasAsciiHost = false; // asciiHost returned failure
        }
	if (hasAsciiHost && this._blockedHosts.some(host => gBrowser.currentURI.asciiHost.endsWith(host))) {
		dump("*** suppress starting gesture on blocked host\n");	// #debug
		return false;
	}
Blocking works correctly for hosts in the block list to prevent gesture start, but if you have just made a successful gesture on an unblocked tab and then try to right click for a context menu on a blocked tab, it isn't enabled. In xdGestureHandler.js, HandleEvent:

Code: Select all

	if (!this._gestureObserver.canStartGesture(event)) 
		break;
needs to be

Code: Select all

	if (!this._gestureObserver.canStartGesture(event)) {
		this._enableContextMenu(true); // blocked host
		break;
	}
That's all I have.

Alan

dragon_fly
Moongazer
Moongazer
Posts: 11
Joined: 2017-10-13, 22:12

Re: MoonGestures release

Post by dragon_fly » 2021-05-15, 20:28

Thank you, Alan!

I've used your fixes and released a new version of the add-on.

I also found another bug.
If you enable "Wheel gestures" in the third (advanced) tab and use "Popup: Back / Forward history", it won't work. Browser console shows some errors about "SessionStore is not defined".
I have looked into the older versions of FireGestures, and tried to use pieces of code from there, but to no avail. This feature is working fine in Basilisk browser, so it is probably similar to the first problem. May I ask you to look into it?

astewart
Apollo supporter
Apollo supporter
Posts: 45
Joined: 2013-12-19, 02:34
Location: San Diego, CA, US

Re: MoonGestures release

Post by astewart » 2021-05-15, 23:04

dragon_fly wrote:
2021-05-15, 20:28
If you enable "Wheel gestures" in the third (advanced) tab and use "Popup: Back / Forward history", it won't work.
I never used those gestures, so I hadn't noticed. It is another change that was made around the time Firegestures was becoming E10s compatible. Back to version 1.10.1 again, browser.js, case "FireGestures:BFHistoryPopup": used to be

Code: Select all

			case "FireGestures:BFHistoryPopup":
				var sessionHistory = gBrowser.webNavigation.sessionHistory;
				if (sessionHistory.count < 1)
					throw "No back/forward history for this tab.";
				var curIdx = sessionHistory.index;
				for (var i = 0; i < sessionHistory.count; i++) {
					let entry = sessionHistory.getEntryAtIndex(i, false);
					if (!entry)
						continue;
					let menuitem = document.createElement("menuitem");
					popup.insertBefore(menuitem, popup.firstChild);
					menuitem.setAttribute("label", entry.title);
					menuitem.setAttribute("statustext", entry.URI.spec);
					menuitem.index = i;
					if (i == curIdx) {
						menuitem.setAttribute("type", "radio");
						menuitem.setAttribute("checked", "true");
						menuitem.setAttribute("default", "true");
						menuitem.className = "unified-nav-current";
					}
					else {
						PlacesUtils.favicons.getFaviconURLForPage(entry.URI, function(aURI) {
							if (!aURI)
								return;
							let iconURL = PlacesUtils.favicons.getFaviconLinkForIcon(aURI).spec;
							menuitem.style.listStyleImage = "url(" + iconURL + ")";
						});
						menuitem.className = i < curIdx
						                   ? "unified-nav-back menuitem-iconic menuitem-with-favicon"
						                   : "unified-nav-forward menuitem-iconic menuitem-with-favicon";
					}
				}
				break;
I pasted this over your version 1.12.0 and it works, but you'll have to make it conditional with the newer code for Basilisk and Pale Moon.

This is more like archaeology than coding :)
Alan

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 9971
Joined: 2012-10-09, 19:37
Location: Sector 001

Re: MoonGestures release

Post by New Tobin Paradigm » 2021-05-15, 23:12

Guys.. If you want to support both Pale Moon and Borealis you will likely need conditional codepaths. My suggestion in this case until you are stronger with JS is find the best and most compatible version with Pale Moon and rebase it on that targeting only Pale Moon. Later on you can add additional codepaths to support Basilisk's FE and target it also at Basilisk.

You CAN have your cake and eat it too but you have to have a cake first.
I actually don't hold a grudge against someone talking trash about me if they're shot afterwards. I try to rise above that and find my own peace.
Image

tman801
Moon lover
Moon lover
Posts: 96
Joined: 2014-10-26, 18:50
Location: Gilbert, Wv.

Re: MoonGestures release

Post by tman801 » 2021-05-16, 02:30

I have used the extension All-In-One Mouse Gesture Suite for the longest time and whenever I am on someone else's computer using the "Other Browser's" I still automatically press right and click left to go back a page. I would then get the drop down menu.

I tried all the mouse gestures in Pale Moon addons but it seems it required you to move mouse left or right. With nerve damage in arm it was a little frustrating, but manageable.

I then tried Moon Gestures 1.12.0 and Tab Kit Mouse Gestures 0.4.0 together and now I have press right, click left to go back or press left, click right to go forward. So far it works on all web pages. It is as if I have the old Mouse Gesture Suites back. Since these are the only two gestures I have ever used I can't say if the two together may affect the other gestures. I can only say for now I am happy. Keep up the good work.

fifonik
Moonbather
Moonbather
Posts: 57
Joined: 2014-08-29, 02:21
Location: Brisbane, Australia

Re: MoonGestures release

Post by fifonik » 2021-05-16, 05:24

tman801 wrote:
2021-05-16, 02:30
I still automatically press right and click left to go back a page
This is called Rocked gestures and is supported by FireGestures. It should also be supported by the MoonGestures if not disabled there.
However, you need to configure it separately. On FireGestures it is on Advanced Options tab.

dragon_fly
Moongazer
Moongazer
Posts: 11
Joined: 2017-10-13, 22:12

Re: MoonGestures release

Post by dragon_fly » 2021-05-16, 10:41

astewart wrote:
2021-05-15, 23:04
I pasted this over your version 1.12.0 and it works, but you'll have to make it conditional with the newer code for Basilisk and Pale Moon.
This is more like archaeology than coding :)
Alan
It surely feels like it, but thanks a lot, Alan!
I've pasted it over, and it works for me as well. I won't be doing any conditioning though, because of two reasons. Firstly, I can't :cry: . Secondly, I've checked this updated version with Basilisk portable (2021-04-27), and it worked.

New Tobin Paradigm wrote:
2021-05-15, 23:12
My suggestion in this case until you are stronger with JS is find the best and most compatible version with Pale Moon and rebase it on that targeting only Pale Moon. Later on you can add additional codepaths to support Basilisk's FE and target it also at Basilisk.
Thank you for the suggestion, Tobin. It makes total sense, yes, but I don't think it is necessary right now.

And I would like to make it clear: if anybody would like to volunteer and become the maintainer of this add-on, that would be just fine by me.

fifonik wrote:
2021-05-16, 05:24
tman801 wrote:
2021-05-16, 02:30
I still automatically press right and click left to go back a page
This is called Rocked gestures and is supported by FireGestures. It should also be supported by the MoonGestures if not disabled there.
However, you need to configure it separately. On FireGestures it is on Advanced Options tab.
Yes, it is here. By default it's switching between tabs, but you can assign it to another option.
Clipboard01.png

User avatar
muelli
Newbie
Newbie
Posts: 5
Joined: 2020-10-29, 09:18

Re: MoonGestures release

Post by muelli » 2021-05-17, 15:33

I'll hijack this topic because there is a new problem in MoonGestures 1.12.0....
I wanted to go to the settings to add own gestures but when clicking settings it just opens this small window:

XML-Verarbeitungsfehler: Nicht-definierte Entität
Adresse: chrome://firegestures/content/prefs.xul
Zeile Nr. 325, Spalte 4: <checkbox id="swipetimeout" label="&swipe.continuous;"
------------------------^

(German locale, XML parsing error, undefined entity)

Any ideas what is going on here? :)
Thanks!

astewart
Apollo supporter
Apollo supporter
Posts: 45
Joined: 2013-12-19, 02:34
Location: San Diego, CA, US

Re: MoonGestures release

Post by astewart » 2021-05-17, 17:09

For me, the Add Script... button does nothing, no error window. And in the Mapping list, there is a "Hybrid" category of builtin gestures missing, just a blank space between "Popup" and user scripts. These work for MoonGestures in Basilisk, so it's more of the same kind of problem.

I think Tobin is right that it would be better to rebase from an earlier version of Firegestures. I suggest 1.10.13 with just the small fix that I gave at the start of this thread. Everything was working for me on Pale Moon with that combo. You would not have the latest "blocked host" feature, but you wouldn't be playing whack-a-mole with changes. You could probably add "blocked host" back in without too much difficulty.

I just threw my modded 1.10.13 in to Basilisk and I didn't see anything not work, but not a careful check. Maybe that's not even an issue for the rest of it.

Alan

tman801
Moon lover
Moon lover
Posts: 96
Joined: 2014-10-26, 18:50
Location: Gilbert, Wv.

Re: MoonGestures release

Post by tman801 » 2021-05-18, 01:51

Thank you fifonik.
I did not have it set to back, because I had it set to previous, so I still needed Tab Kit Mouse Gestures. Now I don't need to also have Tab Kit Mouse Gestures.
I really appreciate all of you that work to make these addon's for those of us that depend on them and don't know how to code.

User avatar
muelli
Newbie
Newbie
Posts: 5
Joined: 2020-10-29, 09:18

Re: MoonGestures release

Post by muelli » 2021-06-02, 13:18

any news? will there be a fix?

Post Reply