localization: don't recheck on DOMContentLoaded
This commit is contained in:
parent
a889ac6413
commit
1ded89969b
|
@ -73,14 +73,15 @@ function tDocLoader() {
|
||||||
tNodeList(document.all);
|
tNodeList(document.all);
|
||||||
|
|
||||||
// localize BODY
|
// localize BODY
|
||||||
const observer = new MutationObserver(mutations => {
|
const process = mutations => {
|
||||||
for (const mutation of mutations) {
|
for (const mutation of mutations) {
|
||||||
tNodeList(mutation.addedNodes);
|
tNodeList(mutation.addedNodes);
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
const observer = new MutationObserver(process);
|
||||||
const onLoad = () => {
|
const onLoad = () => {
|
||||||
tDocLoader.stop();
|
tDocLoader.stop();
|
||||||
tNodeList(document.all);
|
process(observer.takeRecords());
|
||||||
};
|
};
|
||||||
tDocLoader.start = () => {
|
tDocLoader.start = () => {
|
||||||
observer.observe(document, {subtree: true, childList: true});
|
observer.observe(document, {subtree: true, childList: true});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user