Touch events trigger on right click

Talk about code development, features, specific bugzilla bugs, enhancements, patches, and other highly technical things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific referenced Bugzilla bugs, mercurial, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Most "bug reports" do not belong in this board and should initially be posted in Community Support or other relevant support boards.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Post Reply
User avatar
Fierelier
Newbie
Newbie
Posts: 3
Joined: 2020-07-02, 11:32

Touch events trigger on right click

Post by Fierelier » 2020-07-02, 23:06

Hello everybody!

I have been trying to use YouTube's mobile theme as my account was now forced onto the new, slower theme. Worked nicely, just needed to alter my user agent. However, I then noticed that the touch events fire when right clicking, so when I right click a link, I do get the context menu but I also navigate at the same time. I have tried to "fix" it myself by making an addon, but I was not able to because YouTube's JS is just over-engineered.

Might just report this as an annoyance, I suppose. I think no functionality would really be lost if this behavior was to be changed. Either don't trigger touch-events at all (you could be firing multiple functions, after all), or don't trigger touch-events on rightclick. Perhaps add an about:config value to change this behavior, in case something different is desired?

Also, just a few by-questions related to addon development (I hope this is okay): I make my addons with jpm, as described in Mozilla's documentation for legacy addons, but that obviously makes it a Firefox legacy addon, and gets run in compat mode. How do I actually make addons specifically targeted at Pale Moon? -- Also, is there also any documentation for additional Pale Moon API functionality that might be available? I find that it's pretty hard to find information on all this (I tried), I'm glad I even got as far as I did.. :v

Thanks for your consideration ^-^

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Touch events trigger on right click

Post by moonbat » 2020-07-03, 00:19

Fierelier wrote:
2020-07-02, 23:06
I make my addons with jpm, as described in Mozilla's documentation for legacy addons, but that obviously makes it a Firefox legacy addon, and gets run in compat mode. How do I actually make addons specifically targeted at Pale Moon?
Don't use JPM or the addon SDK, use XUL/overlay. The XUL Tutorial and the XUL School Tutorial should get you started. JPM is a horrible kludge that mangles together content and presentation by using Javascript for both unlike XUL, all just to make them restartless. JPM extensions don't play well with toolbars in Pale Moon (or pre 57 Firefox for that matter).
To make your extension target Pale Moon you'll have to add its ID - {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} as a target application in install.rdf. Note that if you do so, you must not target the Firefox ID as well unless your extension is intended to target Basilisk (which shares its ID with Firefox) and you have actually tested it on Basilisk.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
Fierelier
Newbie
Newbie
Posts: 3
Joined: 2020-07-02, 11:32

Re: Touch events trigger on right click

Post by Fierelier » 2020-07-03, 03:58

Thank you for your response. I have had a look at the links you sent me, but I honestly think jpm's stupid-simple free-form approach is more attractive for me. Though thanks to your help, I was able to target Pale Moon by adding {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} to the engines list inside package.json :)

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Touch events trigger on right click

Post by moonbat » 2020-07-03, 05:36

Fierelier wrote:
2020-07-03, 03:58
jpm's stupid-simple free-form approach is more attractive for me.
The trouble is that it definitely is stupid, and it doesn't work well with Pale Moon. I've translated addons from JPM back to overlay, and the effort was worth it.
With XUL your UI code is clean and separate from the functionality, the way any sane software development ought to be.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
Fierelier
Newbie
Newbie
Posts: 3
Joined: 2020-07-02, 11:32

Re: Touch events trigger on right click

Post by Fierelier » 2020-07-05, 05:04

I definitely don't disagree with that, but I don't really do big UI work with my addons, at least not yet. I will get to it some other time if I think it is necessary, but for now I'm okay with how things are.

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Touch events trigger on right click

Post by moonbat » 2020-07-05, 05:52

Even if you don't, overlay code is better organized, besides being easier for targeting all UXP applications. Since you're starting from scratch as I did, doesn't hurt to learn what is more stable and guaranteed to work well in the future.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

Post Reply