Can one create a page modifying extension without any UI overlay in browser.xul?

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
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Can one create a page modifying extension without any UI overlay in browser.xul?

Post by moonbat » 2020-07-03, 16:18

My extension PermissionsPlus overlays the PageInfo dialog and about:permissions, but originally had no reason to overlay browser.xul. The Javascript files for these 2 components are only loaded when the user accesses them, but I needed to perform some initialization at browser startup. Simply creating an empty overlay for the browser with a script tag referencing my script (that has a window.onload to do its stuff) doesn't work and gets logged as 'no chrome registered for script.js'.

So I was forced to add a toolbar button as well. Is it possible to make a traditional overlay extension that doesn't overlay the browser, or alternately, doesn't modify the UI at all?
"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
JustOff
Localization Coordinator
Localization Coordinator
Posts: 2016
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Re: Can one create a page modifying extension without any UI overlay in browser.xul?

Post by JustOff » 2020-07-03, 17:22

moonbat wrote:
2020-07-03, 16:18
Simply creating an empty overlay for the browser with a script tag referencing my script (that has a window.onload to do its stuff) doesn't work and gets logged as 'no chrome registered for script.js'.
That's weird, I guess you missed something very simple.
Is it possible to make a traditional overlay extension that doesn't overlay the browser, or alternately, doesn't modify the UI at all?
Yes, of course, here is an example of the second approach.
Here are the add-ons I made in a spare time. That was fun!

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

Re: Can one create a page modifying extension without any UI overlay in browser.xul?

Post by moonbat » 2020-07-03, 18:46

I was doing more or less what you have done, my overlay is identical with just a stringbundleset, but for one thing -
Is there a difference between doing

Code: Select all

window.addEventListener('load', function() { activestopbutton.init(); }, false);
and simply calling

Code: Select all

window.addEventListener('load', activestopbutton.init, false);
as I've been doing?
"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
JustOff
Localization Coordinator
Localization Coordinator
Posts: 2016
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Re: Can one create a page modifying extension without any UI overlay in browser.xul?

Post by JustOff » 2020-07-03, 20:01

Here are the add-ons I made in a spare time. That was fun!

Post Reply