Why can't I embed this site in an iframe? - iframe

When I put this code into HTML file, it does not show the website.
<iframe src="https://runepedia.com/calculators/combat">
Can somebody help?

It doesn't work because the site set X-Frame-Options HTTP header to DENY.
This means that the browser cannot show the page in an iframe.
From MDN:
deny
The page cannot be displayed in a frame, regardless of the site attempting to do so.

Related

iframe with src with same domain and port as the parent document is not editable/disabled

I have a url (http://localhost:8080/doc1.html) opened in the browser. I have an iframe with url (http://localhost:8080/doc2.html) within the parent document.
The links and forms in the iframe are not enabled. I am unable to click on a link or post the form.
I thought I am not violating the cross-origin policy. The links and form should work.
i had set iframe_obj.style.pointerEvents = "none" as i was doing something on top of the iframe. Now i have set it to "auto" and is editable.

LinkedIn embedded post deletes itself when clicking any link

When using 'Embed this post', if a user clicks on a link anywhere within the iFrame it destroys the html inside. You can replicate this issue by following these steps.
Click '...' at the top right of a post.
Go to 'Embed this post' and copy the iFrame code.
Paste the iFrame code somewhere you can test the HTML.
Click a link anywhere in the embedded post.
At this point you'll see the post disappear. The head and body HTML code is destroyed.
I duplicated the issue here.
<iframe src="https://www.linkedin.com/embed/feed/update/urn:li:share:6481527492011139072" height="777" width="504" frameborder="0" allowfullscreen=""></iframe>
Try clicking on the LinkedIn icon on the top left or the like/comment/share buttons.
I tried reaching out to LinkedIn support on their website but their team directed me here.
Refused to display 'https://www.linkedin.com/authwall?trk=gf&trkInfo=AQFSSEZsXsstdAAAAWi4pJ9YQaz5O2_6IRmktVz1kDhxt_uchm59um--vI7OCCG1Nkz-xFDMqtML8ee4C6Min8NUMPsH3DihIAb3hbhB1WUdxyaT2NxjuAgsaAq6GPKgXJra2gA=&originalReferer=https://www.linkedin.com/embed/feed/update/urn:li:share:6481527492011139072&sessionRedirect=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Faps-technology%3Ftrk%3Dpublic-post_share-update_actor-text' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'"
The content is prohibited from being displayed within an IFRAME due the Content Security Policy being set. The webserver hosting linkedin.com is configured to add a HTTP header to the response object. Specifically they are setting the Content-Security-Policy tag to frame-ancestors 'self'. There is no way you'll be able to embed their pages into a page of your own using IFRAME. There are other techniques that you could use to work around that, but none are as simple as an iframe tag.
W3C Content Security Policy Level 3 - Frame Ancestors
So, it's not something that isn't working, but it's Linkedin that don't let you do it. If you look at the urls you are going to open, also, you could see they are behind the auth wall of linkedin

URL not displayed in Browser

I have wordpress site: www.example.in
Site is working fine,when I click at any other link it works but no sub urls comes in browser
for example if click at "Blog" blog page loads but URL not changing in Browser's url box.
I checked out the website.. the problem here is that you have a frame on your page.. and that frame loads the content from securespin.in.. So basically the main page that is opened in the browser is the index page of linksmart.in.. which doesnot change on clicking on any of the links.. what changes is the content of the frame on this page (content from securespin.in).. hence everything works perfectly but the browser URL wont change.. cuz the page is still the same.. hope it makes sense..!!
If you want the URLs to work for linksmart there are quite a few options. First and simplest will be to host the same website as securespin.in on the linksmart server and let go the Frame..!!
Second option would be to just the change the hash in the URL not the URL as such.. so your URL can be www.linksmart.in#Blog.. for that you can use the following code on the click of the links on the pages on securespin.in
document.parent.location.hash = "Blog";

How to add cross-domain iframe into SalesForce account details tab?

I want to embed iframe section on account tab. I've created simple Visualforce page with
Standart Controller - Account.
<apex:page standardController="Account">
<h1>Congratulations</h1>
This is your new Page
<div>
<apex:iframe src="https://www.facebook.com/" width="800" height="600" />
</div>
</apex:page>
I've added a VisualForce section into account layout. But I'm unable to see my
iframe content in the result details page.
It seems that iframe content is rendered only if my iframe is related to salesforce
domain.
So my question is: Is it possible to embed external domain page into standard details page?
Facebook does not like people framing its content. I believe that is the problem rather than it being salesforce related. To be sure, try swapping the facebook url for this:
"http://www.clubpenguin.com/"
If that works, then you know it's not salesforce blocking you but facebook.
(Club Penguin is just a site I know that happens to allow iframes, so it's a good one to test with!)
When you try and frame facebook you will probably find this error if you look in a browser debugger:
Refused to display document because display forbidden by X-Frame-Options.
There is a discussion of this error here:
Overcoming "Display forbidden by X-Frame-Options"

Display cross domain content in IFrame (IE8)

I realized that IE8 does not allow links from cross domains to be displayed in IFrame.
It seems like there are only two Header options that Microsoft allows to modify.
X-FRAME-OPTIONS : "DENY" (This does not display any IFrame content )
X-FRAME-OPTIONS : "SAMEORIGIN" (Displays content from the same domain)
Is there a work around to allow content from other domains to be displayed?
Thanks in advance
Point your source to an internal, dynamic (server-generated) page that simply proxies the external web page. I.E. You hit src="myContent.asp", and you get www.google.com, or equivalent.

Resources