(function() { const data = { linesLength: window.rehState ? (window.rehState.lines || []).length : 'no rehState', linesSample: window.rehState ? (window.rehState.lines || []).slice(0, 5) : [], a4Display: document.getElementById('reh-a4-page') ? document.getElementById('reh-a4-page').style.display : 'no a4', wrapChildrenCount: document.querySelector('.reh-page-wrap') ? document.querySelector('.reh-page-wrap').children.length : 'no wrap', paperHeights: Array.from(document.querySelectorAll('.reh-paper')).map(p => p.offsetHeight), paperChildrenCount: Array.from(document.querySelectorAll('.reh-paper')).map(p => p.children.length), scriptLinesChildrenCount: document.getElementById('reh-script-lines') ? document.getElementById('reh-script-lines').children.length : 'no script-lines', pageMode: window._pageMode || 'unknown', skipDesc: window.rehState ? window.rehState.skipDescriptions : 'unknown' }; console.log(JSON.stringify(data, null, 2)); alert(JSON.stringify(data, null, 2)); })();