How to get started with Extension Development?

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

Moderators: FranklinDM, Lootyhoof

SamSpeed

How to get started with Extension Development?

Unread post by SamSpeed » 2017-11-07, 20:39

Am looking for guidance -- would like to try my hand at writing an add-on or two. Mainly for personal needs and of course for the challenge. These would fall into the Accessibility category. Being color blind and low vision, I want to be able make some temporary tweaks on a button click.

A few years back FF had an add-on development add-on. It was quirky and buggy and then the project got dropped, and my add-ons stopped working so I dropped that activity and did something else.

So my question to to group is, are there any useful tools, tutorials or references that you would recommend?

Thanks in advance,
Jim

JustOff

Re: How to get started with Extension Development?

Unread post by JustOff » 2017-11-07, 21:17

This is how I started to write extensions in about 10 years ago:

1. Find a simplest add-on that is similar or have part of functions you need
2. Study its sources, try to make small modifications and explore the result

Since Pale Moon is adhere to classic technology for creating add-ons the essential doc is https://developer.mozilla.org/en-US/doc ... a/Tech/XUL, and many other manuals are still available on MDN despite Mozilla already deprecated XUL/XPCOM in favor of WebExtensions.

adisib
Lunatic
Lunatic
Posts: 380
Joined: 2015-06-13, 03:34
Location: KY

Re: How to get started with Extension Development?

Unread post by adisib » 2017-11-07, 22:55

JustOff wrote:This is how I started to write extensions in about 10 years ago:

1. Find a simplest add-on that is similar or have part of functions you need
2. Study its sources, try to make small modifications and explore the result
While this could work for some people, Pale Moon really needs some official resources on the subject.

SamSpeed

Re: How to get started with Extension Development?

Unread post by SamSpeed » 2017-11-07, 23:59

Thanks JustOff, sound advice.

So I searched for "web extension "hello world" example" and found one on a Mozilla site. Man that's a lot of code for Hello World -- remember when it was just one line?

A bit of irony -- at the top of the page is a warning, "Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons." :)

Jim

pulp3894y

Re: How to get started with Extension Development?

Unread post by pulp3894y » 2017-11-09, 18:21

devtools.chrome.enabled

I was modifying firefox extensions without knowing about it for a year, and it was a pure torture, I had to use millions of console.log and alert everywhere and restart everything on the smallest of changes. Now I just copypaste a function I changed directly into the browser console, and see results almost immediately.

After that, read about XPCOM and interfaces a bit.

https://en.wikipedia.org/wiki/XPCOM

https://developer.mozilla.org/en-US/Add ... s/File_I_O

http://books.mozdev.org/html/mozilla-chp-8.html

http://mozilla.6506.n7.nabble.com/what- ... 60597.html

pulp3894y

Re: How to get started with Extension Development?

Unread post by pulp3894y » 2017-11-11, 11:19

By the way, anybody knows how require() works right now in palemoon?

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

Re: How to get started with Extension Development?

Unread post by coffeebreak » 2017-11-11, 12:06

pulp3894y wrote:By the way, anybody knows how require() works right now in palemoon?
You've posted the same question here: How to use require() ?

I'm sure someone will respond when and if they are able. But double-posting won't make that happen any faster.