Help Developing in Web Panels
-
- Why are JavaScript alerts not showing in web panels?
- What event to listen for to know when the web panel is opened?
Thank you!
--
ModEdit: Moved from Support
-
This isn’t really a modification question, it’s an extension question. But maybe the people here would be better able to help.
-
@code3 But I think (think not know) that it is only possible / much easier with mods – you can just watch the
PANEL_STATE
(or what was it) in the storage & prolly inject a script.I don’t know about the alerts.
-
@potmeklecbohdan I’m making an extension, not a mod. I guess the alternative is to update automatically by broadcasting events.
-
@code3 said in Help Developing in Web Panels:
- What event to listen for to know when the web panel is opened?
This fires on panel opening but not closing:
window.addEventListener('resize', () => { console.log("Panel opened..."); });
As long as you don't need to worry about detecting closing as well, then that should work.
There is also this to check out:
https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API -
Ppafflick moved this topic from Extensions on