Blocked a frame with origin "http://localhost"

Bhargav Chudasama picture Bhargav Chudasama · Oct 11, 2018 · Viewed 9.4k times · Source

i have working on idx plugin for property search.its a http link given to search property but i want to conver this link to https for that purpose i used <iframe> and i put https: link on iframe its working fine.

but problem happen with iframe content its content have a form which will action with http so i will also convert its https so have used jquery for that to change content of iframe but it will give me a error

Uncaught DOMException: Blocked a frame with origin "http://localhost" from accessing a cross-origin frame.

Iframe Code

<iframe src="https://www.idxhome.com/homesearch/xxxxx" width="100%" height="1750" frameborder="0" allowtransparency="true" id="foo" sandbox="allow-same-origin allow-scripts">

jquery code

  var iframe = document.getElementById("foo");
  var elmnt = iframe.contentWindow.document.getElementsByTagName("body");
  elmnt.style.display = "none";

iframe form content with http action i want change it https

<form id="ihf-contact-request-form" class="form-inline" data-ihf-event="contact-form-submit" action="http://www.idxhome.com/contact/submit/ajax/126024" method="POST" data-ihf-event-bound="true"> /form>

how i will do that i have try and search all things related to that but its have not working for me.

Answer