|
16 | 16 | mutations.forEach((mutation) => {
|
17 | 17 | if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
18 | 18 | const theme = htmlElement.classList.contains('theme-light') ? 'light' : 'dark';
|
19 |
| - // console.log(theme) |
20 | 19 | updateIframeThemes(theme);
|
21 | 20 | }
|
22 | 21 | });
|
|
54 | 53 | if (resize) {
|
55 | 54 | resize_iframe_out(el)
|
56 | 55 | }
|
57 |
| - |
58 |
| - // if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) { |
59 |
| - |
60 |
| - // } |
61 | 56 | });
|
62 | 57 |
|
63 | 58 | observer.observe(el.contentDocument.documentElement, {childList: true, subtree: true, characterData: true, attributes: true});
|
64 | 59 |
|
65 | 60 | }
|
66 | 61 |
|
67 | 62 | function observeIFrame(el) {
|
68 |
| - // console.log("el.contentWindow: " + el.contentWindow) |
69 |
| - // console.log("el.contentWindow.document: " + el.contentWindow.document) |
70 |
| - // console.log("el.contentWindow.document.body: " + el.contentWindow.document.body) |
71 |
| - // console.log("el.contentWindow.performance: " + el.contentWindow.performance) |
72 |
| - // console.log("el.contentWindow.performance.timing.loadEventEnd: " + el.contentWindow.performance.timing.loadEventEnd) |
73 |
| - |
74 | 63 | if (el.contentWindow && el.contentWindow.performance && el.contentWindow.performance.timing.loadEventEnd === 0) {
|
75 |
| - // console.log("ready path") |
76 | 64 | el.addEventListener('load', () => doObserveIFrame(el), true)
|
77 | 65 | } else {
|
78 |
| - // console.log("not ready path") |
79 | 66 | doObserveIFrame(el)
|
80 | 67 | }
|
81 | 68 | }
|
|
90 | 77 | mutations.forEach(function (mutation) {
|
91 | 78 | for (let i = 0; i < mutation.addedNodes.length; i++) {
|
92 | 79 | let addedNode = mutation.addedNodes[i];
|
93 |
| - // console.log(addedNode.tagName) |
94 | 80 | if (addedNode.tagName === 'IFRAME') {
|
95 |
| - // console.log("IFRAME loaded") |
96 | 81 | observeIFrame(addedNode);
|
97 | 82 | } else if (addedNode.tagName === 'SECTION') {
|
98 | 83 | let iframes = [];
|
|
0 commit comments