let headings = ["H2", "H3", "H4"];

if(window.top.menu) {
    window.addEventListener('click', (event) => {
        if(headings.includes(event.target.nodeName)) {
            window.top.menu.postMessage({id: event.target.id}, "*")
        }
    });
} else throw new Error("The link to the parent window is missing!");
