Event for when MM ready?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Event for when MM ready?

Re: Event for when MM ready?

by Ludek » Wed Aug 16, 2023 8:28 am

Watching code in maincontent.js and there is rather:

Code: Select all

whenReady(function () {
    if (!builtInMenu) {
        app.listen(window.thisWindow, 'scriptsLoaded', () => {
            uitools.refreshMenu();
        });
    }
So probably the 'scriptsLoaded' event is the event that you are looking for?

Re: Event for when MM ready?

by PetrCBR » Mon Aug 07, 2023 6:25 am

Show me whenReady code and what object you've added to app.listen ?

Event for when MM ready?

by DaledeSilva » Fri Jul 21, 2023 10:21 am

I found in this documentation that I can use window.whenReady(callback) to know when MM and all scripts are loaded, however, I'm trying to attack some app.listener events and I'm getting errors

Code: Select all

mminit.js:2558 Uncaught Error: addEventListener function not found! Event change
at Object.app.listen (mminit.js:2558:26)
Is there another event I can hook into to know when it's safe to start setting up my script?

Thanks :)
Dale.

Top