Splashed! [support topic]
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!
Please do not create new topics here unless you are an extension author in need of a dedicated releases&support thread!
- FranklinDM
- Add-ons Team
- Posts: 369
- Joined: 2017-01-14, 02:40
- Location: Manila, Philippines
- Contact:
Re: Splashed! [support topic]
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.
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
- FranklinDM
- Add-ons Team
- Posts: 369
- Joined: 2017-01-14, 02:40
- Location: Manila, Philippines
- Contact:
Re: Splashed! [support topic]
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.
Re: Splashed! [support topic]
You defined the function Init, but did not call it. Just call it.
It works.
Code: Select all
function init() {
...
};
init();
- FranklinDM
- Add-ons Team
- Posts: 369
- Joined: 2017-01-14, 02:40
- Location: Manila, Philippines
- Contact:
Re: Splashed! [support topic]
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">
Re: Splashed! [support topic]
It does not work for some reason.
Try to do as I wrote.
Re: Splashed! [support topic]
Probably, the alpha channel setting does not have an effect after the window is drawn. But it works before drawing.
- FranklinDM
- Add-ons Team
- Posts: 369
- Joined: 2017-01-14, 02:40
- Location: Manila, Philippines
- Contact:
Re: Splashed! [support topic]
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.
- FranklinDM
- Add-ons Team
- Posts: 369
- Joined: 2017-01-14, 02:40
- Location: Manila, Philippines
- Contact:
Re: Splashed! [support topic]
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.
Re: Splashed! [support topic]
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.
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

"Compromise and collaboration lie at the heart of all great endeavours" -- Kassandra

- FranklinDM
- Add-ons Team
- Posts: 369
- Joined: 2017-01-14, 02:40
- Location: Manila, Philippines
- Contact:
Re: Splashed! [support topic]
Update to Splashed: v1.4.2
- Update install manifest