Splashed! [support topic]

Dedicated board for extension releases/support threads

Moderators: FranklinDM, Lootyhoof

Forum rules
Please do not create new topics here unless you are an extension author in need of a dedicated releases&support thread!
User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 367
Joined: 2017-01-14, 02:40
Location: Manila, Philippines
Contact:

Re: Splashed! [support topic]

Unread post by FranklinDM » 2022-01-26, 15:37

The extension modifies the background of the splash window by setting the style attribute of the window element via JS. While testing some stuff around, I've found a workaround that allows transparency without reverting bug 1239743. It works if I set the window background to transparent on the XUL overlay file directly, but if it's only done through JS, it doesn't work. In other words, transparent chrome windows still work but they must be set in the overlay file directly (or probably through CSS), but doing so programmatically via JS is broken.

I've attached a rough test extension with a toolbar button providing 3 options: (a) static, (b) scripted, and (c) opaque. With static, the background is already set to transparent in the overlay (the workaround); scripted sets the style attribute and changes the background to transparent via JS (broken and uses black background if the mentioned bug is not reverted); opaque is just a regular splash window with a non-transparent background.

The workaround I've found is odd but it works as-is (and will be included in the next update to this extension). I think it's the most appropriate way rather than to not constrain the window's texture size.
Attachments
src.xpi
Splash test extension
(3.63 KiB) Downloaded 3 times

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 367
Joined: 2017-01-14, 02:40
Location: Manila, Philippines
Contact:

Re: Splashed! [support topic]

Unread post by FranklinDM » 2022-01-27, 04:29

Update to Splashed: v1.4.0
  • Include workaround for transparent splash windows
    - Transparent backgrounds for the splash window can now be set again, by changing splash background color to transparent and adding background: transparent; to the window style.
Update options: GitHub releases, APO, Basilisk Add-ons Site, Interlink Add-ons Site, manually check for updates through the Add-ons Manager.

User avatar
Kris_88
Lunatic
Lunatic
Posts: 277
Joined: 2021-01-26, 11:18

Re: Splashed! [support topic]

Unread post by Kris_88 » 2022-01-27, 05:01

FranklinDM wrote:
2022-01-26, 15:37
but if it's only done through JS, it doesn't work.
You defined the function Init, but did not call it. Just call it.
It works.

Code: Select all

function init() {
...
};

init();

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 367
Joined: 2017-01-14, 02:40
Location: Manila, Philippines
Contact:

Re: Splashed! [support topic]

Unread post by FranklinDM » 2022-01-27, 05:14

Kris_88 wrote:
2022-01-27, 05:01
You defined the function Init, but did not call it.
It's called on page load:

Code: Select all

<window id="splashscreen"
        title="Splash"
        windowtype="Splash:Test"
        onclick="window.close();"
        onload="init();"
        flex="1"
        hidechrome="true"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

User avatar
Kris_88
Lunatic
Lunatic
Posts: 277
Joined: 2021-01-26, 11:18

Re: Splashed! [support topic]

Unread post by Kris_88 » 2022-01-27, 05:27

FranklinDM wrote:
2022-01-27, 05:14
It's called on page load:
It does not work for some reason.
Try to do as I wrote.

User avatar
Kris_88
Lunatic
Lunatic
Posts: 277
Joined: 2021-01-26, 11:18

Re: Splashed! [support topic]

Unread post by Kris_88 » 2022-01-27, 05:46

Probably, the alpha channel setting does not have an effect after the window is drawn. But it works before drawing.

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 367
Joined: 2017-01-14, 02:40
Location: Manila, Philippines
Contact:

Re: Splashed! [support topic]

Unread post by FranklinDM » 2022-01-27, 08:50

It also works with DOMContentLoaded, thanks. I'll be using this instead in the next update. The thing is, this used to work regardless of when the background is set before the said bug landed.

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 367
Joined: 2017-01-14, 02:40
Location: Manila, Philippines
Contact:

Re: Splashed! [support topic]

Unread post by FranklinDM » 2022-01-27, 08:56

Update to Splashed: v1.4.1
  • Simplify preview image handling in options window
  • Use DOMContentLoaded event for splash initialization
    - Removes workaround included in the previous version.
Update options: GitHub releases, APO, Basilisk Add-ons Site, Interlink Add-ons Site, manually check for updates through the Add-ons Manager.

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

Re: Splashed! [support topic]

Unread post by Moonchild » 2022-01-27, 11:08

The fact it worked before was probably due to timing. You seem to have hit a race condition and the "onload" would be unrealiable because DOM would not be fully initialized yet, likely overwriting the js-set style with what was defined in the window definition (i.e. it would be applied then immediately reset). Timing changed with the extra check being introduced because it would make calls to the renderer.
DOMContentLoaded will always only fire after the document structure has been finalized, avoiding that race.
"You will observe with concern how long a useful truth may be known and exist before it is generally received and practiced on." -- Benjamin Franklin
"Compromise and collaboration lie at the heart of all great endeavours" -- Kassandra
Image

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 367
Joined: 2017-01-14, 02:40
Location: Manila, Philippines
Contact:

Re: Splashed! [support topic]

Unread post by FranklinDM » 2022-02-02, 15:46

Update to Splashed: v1.4.2
  • Update install manifest
Update options: GitHub releases, APO, Basilisk Add-ons Site, Interlink Add-ons Site, manually check for updates through the Add-ons Manager.

Post Reply