A frame is connected on the page.
I track the onClick event by frame and change its size:
document.getElementById('widget_iframe').onload = function() { document.getElementById("widget_iframe").contentWindow.document.getElementById('chat_header').onclick = function() { $('#widget_chat').animate({height: 400, width: 300}, 200); } document.getElementById("widget_iframe").contentWindow.document.getElementById('chat_header_full').onclick = function() { $('#widget_chat').animate({height: 40, width: 330}, 200); } } Everything works on one domain, if you connect an iframe on another domain, I get an error (work on http, not https):
Uncaught DOMException: Blocked a frame with origin " http: //main.domen " from accessing a cross-origin frame. at HTMLIFrameElement.document.getElementById.onload
Can you please tell me how to get around this limitation?