| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
(function () { |
| 7 |
if (window.parent === window) return; |
| 8 |
var root = document.documentElement, last = 0; |
| 9 |
var send = function () { |
| 10 |
var h = Math.ceil(Math.max(root.scrollHeight, document.body ? document.body.scrollHeight : 0)); |
| 11 |
if (h && h !== last) { |
| 12 |
last = h; |
| 13 |
window.parent.postMessage({ oxygenhubReport: { height: h } }, "*"); |
| 14 |
} |
| 15 |
}; |
| 16 |
window.addEventListener("message", function (e) { |
| 17 |
if (e.source !== window.parent) return; |
| 18 |
var t = e.data && e.data.oxygenhubTheme; |
| 19 |
if (t === "dark" || t === "light") root.dataset.theme = t; |
| 20 |
}); |
| 21 |
window.addEventListener("load", send); |
| 22 |
if (window.ResizeObserver) new ResizeObserver(send).observe(root); |
| 23 |
else setInterval(send, 500); |
| 24 |
window.parent.postMessage({ oxygenhubReport: { ready: true } }, "*"); |
| 25 |
})(); |