I've been thinking about building a very simple extension...

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

Moderators: FranklinDM, Lootyhoof

BenFenner
Lunatic
Lunatic
Posts: 308
Joined: 2015-06-01, 12:52
Location: US Southeast

I've been thinking about building a very simple extension...

Unread post by BenFenner » 2021-07-26, 02:05

Moderator note: Split topic

But I've been thinking about building a very simple extension (from scratch, or as near as is practical) to learn that side of things.
Where would I go for a quick guide or tutorial for creating a Pale Moon extension from scratch in the most preferred (by the PM team) way?
(For an idea of what this extension would accomplish, see this post of mine from 2016: viewtopic.php?f=5&t=11569&p=81497#p81497)

If no one wants to point me in the right direction, I'll search myself and eventually figure it out. :thumbup:

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: UXP development: it doesn't magically happen.

Unread post by New Tobin Paradigm » 2021-07-26, 02:59

To answer your most important question: Other extensions as well as the structure of how the Bookmarks menu is constructed. I could likely do it now but it isn't as simple as any other menu item. You would be served to start simpler than that.
The avalanche has already started. It is too late for the pebbles to vote.
Image

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 3396
Joined: 2015-12-09, 15:45
Contact:

Re: UXP development: it doesn't magically happen.

Unread post by moonbat » 2021-07-26, 08:52

BenFenner wrote:
2021-07-26, 02:05
Where would I go for a quick guide or tutorial for creating a Pale Moon extension from scratch in the most preferred (by the PM team) way?
XUL School Tutorial and XUL Tutorial should get you started, from RealityRipple's backup of MDN. The former takes you through a 'hello world' extension as well.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

BenFenner
Lunatic
Lunatic
Posts: 308
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: UXP development: it doesn't magically happen.

Unread post by BenFenner » 2021-07-26, 16:57

New Tobin Paradigm wrote:
2021-07-26, 02:59
I could likely do it now but it isn't as simple as any other menu item. You would be served to start simpler than that.
If you are saying this, I assume it will be well outside something I want to tackle any time soon.

I've had one more extension idea. Do you think this would be a better place to start?

The idea would be to auto-click (or similar) the YouTube prompt that comes up asking if you (the user) are still watching.

Does that sound a lot easier than conditionally cleaning up the bookmarks menu?

moonbat wrote:
2021-07-26, 08:52
XUL School Tutorial and XUL Tutorial should get you started, from RealityRipple's backup of MDN. The former takes you through a 'hello world' extension as well.
Thank you moonbat. I assume these would direct me how to built extensions the current preferred way for Pale Moon? It's not going to get me into Jetpack or anything similar and unloved, right? Just checking.

Edit: I'm on Linux often. Should I check out Sidecar, or work on being proficient without those types of tools? viewtopic.php?f=46&t=26886

Edit 2:
vannilla wrote:
2021-05-19, 19:35
→ I'm new to extension development; will Sidecar help me develop/learn?
Probably, but I suggest doing things manually at least the first couple of times.
I hear that loud and clear. :thumbup:

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: UXP development: it doesn't magically happen.

Unread post by New Tobin Paradigm » 2021-07-26, 17:18

So a userscript that already exists and thousands already use. Perhaps this line of discussion should be split off into another topic.
The avalanche has already started. It is too late for the pebbles to vote.
Image

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 30846
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: UXP development: it doesn't magically happen.

Unread post by Moonchild » 2021-07-26, 17:47

This had nothing to do with platform development. How did we end up on extensions again? Seriously people, get your topics separated and categorised.

(topic split)
"Just because you know something is going to break in the end, doesn't mean that it can't have an effect that lasts into the future. Joy. Wonder. Laughter. Hope. The world can be better because of what you built in the past." -- Tom Scott
Image

vannilla
Board Warrior
Board Warrior
Posts: 1772
Joined: 2018-05-05, 13:29

Re: I've been thinking about building a very simple extension...

Unread post by vannilla » 2021-07-26, 21:09

BenFenner wrote:
2021-07-26, 16:57
Edit 2:
vannilla wrote:
2021-05-19, 19:35
→ I'm new to extension development; will Sidecar help me develop/learn?
Probably, but I suggest doing things manually at least the first couple of times.
I hear that loud and clear. :thumbup:
As far as I'm concerned you can do whatever you want, that Q&A in particular is really to make sure people unsure of how to proceed don't end up messing things up without realizing it.
If you follow the tutorial at XUL school you can probably use Sidecar without too many issues, maybe just the few idiosyncrasies inherent of the tool, but that's it.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2822
Joined: 2015-09-26, 04:51
Location: U.S.

Re: I've been thinking about building a very simple extension...

Unread post by coffeebreak » 2021-07-26, 21:16

BenFenner wrote:
2021-07-26, 02:05
(For an idea of what this extension would accomplish, see this post of mine from 2016: viewtopic.php?f=5&t=11569&p=81497#p81497)
Concerning this particular idea...
I'm sure you already know this, but those menu items are already easy for anyone to hide with userChrome (or a Stylem style) without a dedicated extension ...unless you had something fancier in mind than just hiding them...?

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 3396
Joined: 2015-12-09, 15:45
Contact:

Re: I've been thinking about building a very simple extension...

Unread post by moonbat » 2021-07-27, 03:38

BenFenner wrote:
2021-07-26, 16:57
I assume these would direct me how to built extensions the current preferred way for Pale Moon? It's not going to get me into Jetpack or anything similar and unloved, right?
Yeah, the XUL based extension technology is called overlay extensions, as opposed to the later Addon SDK and Jetpack, which are separate topics in MDN docs.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 20.1 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: I've been thinking about building a very simple extension...

Unread post by New Tobin Paradigm » 2021-07-27, 03:46

Jetpack IS the Add-ons SDK.
The avalanche has already started. It is too late for the pebbles to vote.
Image

Attronarch
Apollo supporter
Apollo supporter
Posts: 42
Joined: 2016-03-21, 12:35

Re: UXP development: it doesn't magically happen.

Unread post by Attronarch » 2021-07-27, 04:02

BenFenner wrote:
2021-07-26, 16:57
I've had one more extension idea. Do you think this would be a better place to start?

The idea would be to auto-click (or similar) the YouTube prompt that comes up asking if you (the user) are still watching.

Does that sound a lot easier than conditionally cleaning up the bookmarks menu?
Why not start with forking some extensions from this list: http://developer.palemoon.org/docs/phoenix-extensions/

You get to learn something, whilst making extensions that people asked for.

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: I've been thinking about building a very simple extension...

Unread post by New Tobin Paradigm » 2021-07-27, 04:56

I maintain the best way to start is by example. Even if it is a shitty example you still learn something. Like how NOT to make an extension later on as you learn more.
The avalanche has already started. It is too late for the pebbles to vote.
Image

BenFenner
Lunatic
Lunatic
Posts: 308
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: UXP development: it doesn't magically happen.

Unread post by BenFenner » 2021-07-27, 13:39

Moonchild wrote:
2021-07-26, 17:47
(topic split)
Thank you! I knew it had gotten way off topic. :oops:
Attronarch wrote:
2021-07-27, 04:02
Why not start with forking some extensions from this list: http://developer.palemoon.org/docs/phoenix-extensions
That's not how I prefer to learn. I prefer to begin with a blank slate, get confused, drown in misery, then slowly climb out with well-earned skill and confidence.
I would think learning to build extensions by forking an existing one would provide some helpful insight only after I've floundered a good bit on my own without anything to lean on.
coffeebreak wrote:
2021-07-26, 21:16
BenFenner wrote:
2021-07-26, 02:05
(For an idea of what this extension would accomplish, see this post of mine from 2016: viewtopic.php?f=5&t=11569&p=81497#p81497)
Concerning this particular idea...
I'm sure you already know this, but those menu items are already easy for anyone to hide with userChrome (or a Stylem style) without a dedicated extension ...unless you had something fancier in mind than just hiding them...?
I did not know that. My plan was to conditionally hide the unwanted/unused Bookmark controlls instead of hiding them outright. But if something workable can be accomplished with userChrome then I am interested.
It would be a bit annoying to apply one-by-one to my 5+ machines (whereas an extension might be easier to mass-install) but I'll take what I can get.
New Tobin Paradigm wrote:
2021-07-26, 17:18
So a userscript that already exists and thousands already use.
That's good to know. So it should be possible, and a good learning exercise for me to put into an extension.

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: I've been thinking about building a very simple extension...

Unread post by New Tobin Paradigm » 2021-07-27, 14:32

No, because arbitrary content script injection is a rather advanced topic I have yet to master. Jetpack can do it very simply but manually through traditional methods? That is something I would kill for as a generic example.

One I have asked for multiple times and no one has bothered to produce. I know thus far that the Jetpack method internally uses the js sandbox and subscript loader features to do it like the JS Scratchpad does. It also seems GreaseMonkey uses the same mechinism as well but both are encumbered by their associated functions surrounding them so isolating ONLY what I need has been a bit of a bitch.
Last edited by New Tobin Paradigm on 2021-07-27, 14:38, edited 1 time in total.
The avalanche has already started. It is too late for the pebbles to vote.
Image

BenFenner
Lunatic
Lunatic
Posts: 308
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: I've been thinking about building a very simple extension...

Unread post by BenFenner » 2021-07-27, 14:38

Well then, I may also avoid that one as too difficult.

I'll stick with Hello World, go from there, and see what I can accomplish that might be interesting or of note.

If I get frisky, maybe I'll eventually try the Bookmark or YouTube auto-click thing. It sounds like the latter could be useful in other ways. :thumbup:

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: I've been thinking about building a very simple extension...

Unread post by New Tobin Paradigm » 2021-07-27, 14:40

You would be better served by starting with an otherwise fully functional fork of some extension. As I keep saying. Otherwise you will fail badly.
The avalanche has already started. It is too late for the pebbles to vote.
Image

vannilla
Board Warrior
Board Warrior
Posts: 1772
Joined: 2018-05-05, 13:29

Re: I've been thinking about building a very simple extension...

Unread post by vannilla » 2021-07-27, 15:55

There's nothing wrong in failing badly.
What's wrong is stopping after it.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2822
Joined: 2015-09-26, 04:51
Location: U.S.

Re: I've been thinking about building a very simple extension...

Unread post by coffeebreak » 2021-07-27, 16:11

BenFenner wrote:
2021-07-27, 14:38
YouTube auto-click thing.
Perhaps take a look at this that seems to have a similar goal:
YouTubeNonStop

BenFenner
Lunatic
Lunatic
Posts: 308
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: I've been thinking about building a very simple extension...

Unread post by BenFenner » 2021-07-27, 17:18

That extension (add-on? I never learned the difference) is quite interesting. I'll give it a try. I wonder how it works, and if it does what Tobin was hoping for...
(Edit: I took a look at the source, and maybe it does? I don't know, but it was easy enough to follow...)

As for forking something existing and working from there. I'm not sure why that is being suggested as the best way to learn. It seems so antithetical to me. :think:

But if I (or someone else) were to do that, would there be a good suggestion as to which extension to fork to begin learning? Something that maybe does one small/easy thing well, or uses the basics to get the job done?

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 10471
Joined: 2012-10-09, 19:37
Location: The Seriphia Galaxy

Re: I've been thinking about building a very simple extension...

Unread post by New Tobin Paradigm » 2021-07-27, 19:00

ffs just go away and stop wasing everyone's time if you aren't going to shut up, buckle down, and do something productive.
The avalanche has already started. It is too late for the pebbles to vote.
Image

Post Reply