Creating basic options xul page for extension Topic is solved

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

Moderators: FranklinDM, Lootyhoof

own3mall
Apollo supporter
Apollo supporter
Posts: 41
Joined: 2014-10-22, 00:32
Location: USA

Creating basic options xul page for extension

Unread post by own3mall » 2023-06-23, 16:18

Hi All,

I wanted to add a basic checkbox option to my YouTubeNonStop plugin, but I haven't found clear instructions for making that possible.

Is there an extension I can refer to as to how I can create a very simple "Options" page for the extension that has a simple checkbox? Or detailed instructions for making this process as simple as possible?

If I can even get that far, once the checkbox has been checked by the user, how do I save that setting and then read that value into the main xul overlay script responsible for interacting with the page / tabs DOM?

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 204
Joined: 2020-03-02, 16:04

Re: Creating basic options xul page for extension

Unread post by Nuck-TH » 2023-06-23, 17:29

When i was converting FLST options to inline options(options.xul) i based off JustOff's Lull the tabs. Note that this is not fully functional XUL document(as far as i gather - it is some not very clean hack which inlines contents of options.xul into addons manager, hence the name of this options type), so very limited subset of functionality will work.
Prefs are saved on modification.
Unfortunately i can't tell how exactly you watch for pref modification. IIRC the simplest way is to always refer to pref in your xul/js code, but this may have delayed effect if some of your code executed once per page reload or especially if once per window/tab creation.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2194
Joined: 2018-05-05, 13:29

Re: Creating basic options xul page for extension

Unread post by vannilla » 2023-06-23, 18:38


own3mall
Apollo supporter
Apollo supporter
Posts: 41
Joined: 2014-10-22, 00:32
Location: USA

Re: Creating basic options xul page for extension

Unread post by own3mall » 2023-06-23, 21:31

Thank you, this is perfect.

Not a big deal, but is there a way to add a line break between radio options somehow in the xul?

I tried `<br />` but that didn't push the second radio option to a new line.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Creating basic options xul page for extension

Unread post by Moonchild » 2023-06-23, 21:44

XUL is not HTML :)

You probably want to put items in an <hbox> or <vbox> to organise them in the layout you prefer, or put an orient="vertical" on a containing box to have items one below the other, instead.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite