diff --git a/src/ecmascript/quickjs/document.c b/src/ecmascript/quickjs/document.c index f78b4962d..1d27fa441 100644 --- a/src/ecmascript/quickjs/document.c +++ b/src/ecmascript/quickjs/document.c @@ -2074,6 +2074,10 @@ document_event_handler(dom_event *event, void *pw) } if (!strcmp("DOMContentLoaded", dom_string_data(typ))) { + if (doc_private->state == COMPLETE) { + dom_string_unref(typ); + return; + } doc_private->state = COMPLETE; } // interpreter->heartbeat = add_heartbeat(interpreter);