I am currently working on a website which must download content from another website through the use of an iframe. Is there any way that I can crop the contents of the downloaded page to only show a section of that page on my website?
I am currently working on a website which must download content from another website
Share
No. The Same Origin Policy prevents you from manipulating the
iframein any way, including the scroll position.There would be a workaround by putting the
iframeinto an adivcontainer that has a defined height and width, andoverflow: hiddento clip the view port:and giving the
iframea relative position:this way, you can adjust the portion of the iframe that is visible on the page. However, the whole page still gets rendered, and this approach is not immune to influences like scrolling inside the iframe.