How to make changes using jQuery within an iframe on another domain?

Asked

Viewed 79 times

0

Hello I need to upload a partner site within my site. However I would like to make changes to the stylization using jQuery preferably.

I found the solution below to manipulate the elements.

$('.header__logo', window.parent.meuIframe.document).style["display"] = "none";

But when executing I came across the following error:

blocked a frame with origin null from accessing a cross-origin frame

Such a change is possible to be made, it would have some way not to fall into the same-origin policy? .

1 answer

0

Being from another realm you are naturally subject to Same-origin policy.

Not knowing your server language, you can try to get the html content from the page and save that html content on your side and generate the iframe from there.

Alternatively, take a look at the Window.postMessage

Browser other questions tagged

You are not signed in. Login or sign up in order to post.