How do I listen for initial content load in Froala Editor?

I’ve read through the docs in Froala Editor and got no luck from the support email. Searches on google have produced few results and I’ve already looked through a number of subreddits to find an answer but anything I find is 4+ years old.

We use Froala in the company and there is no way I can switch out of it so I need to find a solution to this.

I am writing a plugin and I need it to perform an action on the html when the editor is initialized and the initial content is set.

I am using the editor thusly:

<template>
    <div>
        <textarea v-model="textContent" :name="name" style="display: none;" ></textarea>
        <froala v-model="textContent" :config="config"></froala>
    </div>
</template>

I am listening to the editor.initialized event in my plugin but there is no html content through editor.html.get() at this point.

The contentChanged event triggers on every content change but resets the caret to the start of the text area every time, which is not ideal.

Once my content is cleaned up I then write it back to the editor with editor.html.set(content)

Is there a specific event to listen for which will fire when the initial content load on the editor has finished?

Failing this I’m going to have to be dirty and set a flag somehow so that I can use the contentChanged event only once. But that feels like a hack!

The plugin is designed to run some custom cleanup on the html that is pasted into the editor so that we can conform fonts to only our fonts, colours to our colours, etc.
It also needs to run on initialization so that those who have already pasted content with incorrect fonts and colours will have it ‘conformed’ when they load up the editor.

Here’s the plugin code:

        function _init() {

            editor.events.on('initialized', function (e) {
                _cleanup();
            });

            editor.events.on('paste.after', function () {
                _cleanup();
            });
        }

Any help would be appreciated

I’ve already tried using initialized event but that doesn’t have any html content in the editor at this point.

I have also tried using contentChanged which works on init but then resets the caret to the beginning of the editor whenever anything is typed.

I have tried html.afterGet which doesn’t fire on init so doesn’t work for this. Likewise for html.afterSet.