PageSourceSearch

https://www.briccius.de/assets/js/set_iframe_height.js

js briccius.de collected 2026-10-02 21:43:33 UTC 1,093 bytes, 41 lines download raw bytes

1/**
2 * Sets the height of a specific iframe.
3 *
4 * @param {string} id - The ID of the iframe to be manipulated
5 * @param {number} ht - The height to be applied to the iframe
6 * @return void
7 */
8function setIframeHeightCO(id, ht) {
9    var ifrm = document.getElementById(id);
10
11    // Hide it as long as its height was not manipulated
12    ifrm.style.visibility = 'hidden';
13
14    // some IE versions need a bit added or scrollbar appears
15    ifrm.parentElement.style.height = ht + 20 + "px";
16    ifrm.style.visibility = 'visible';
17}
18
19/**
20 * Handles the height for an iframe to be applied
21 * that was sent via postMessage.
22 *
23 * @param {event} e
24 * @return void
25 */
26function handleDocHeightMsg(e) {
27    // Check origin
28    if ( e.origin === 'https://ekm.descript.de' ) {
29        // parse data
30        var data = JSON.parse( e.data );
31        // check data object
32        if ( data['docHeight'] ) {
33            setIframeHeightCO( 'iFrameBEJM', data['docHeight'] );
34        }
35    }
36}
37
38/**
39 * Attaches an handler for 'message' events
40 */
41window.addEventListener('message', handleDocHeightMsg, false);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.