Update index.js

trigger only  after document readstate change to complete
This commit is contained in:
Neil deGrasse Tyson 2024-11-02 14:01:20 +08:00 committed by GitHub
parent cb790fd466
commit 72bc3299e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -223,12 +223,14 @@
}; };
const init = () => { const init = () => {
if (!initialized) { if(document.readyState==='complete'){
track(); if (!initialized) {
handlePathChanges(); track();
handleTitleChanges(); handlePathChanges();
handleClicks(); handleTitleChanges();
initialized = true; handleClicks();
initialized = true;
}
} }
}; };