camino
camino

Reputation: 10584

how to run my own js before FrameLoadEnd event in cefsharp

I would like to disable lazy image loading, so I want to run the following js code before FrameLoadEnd event is triggered.

$('#images img').each(function() {
    $(this).attr("src", $(this).attr("original"));
});

Is it possible?

Upvotes: 0

Views: 203

Answers (1)

amaitland
amaitland

Reputation: 4410

You can execute JavaScript in FrameLoadStart, the event is fired very early in the page load lifecycle, before the DOM has loaded.

You execute JavaScript in FrameLoadStart to hook the DOMContentLoaded event, in practice this is often very similar in timing to FrameLoadEnd event.

window.addEventListener('DOMContentLoaded', (event) => {
    //Do something on DOM load.
});

Upvotes: 1

Related Questions