LinkedIn embedded post deletes itself when clicking any link - iframe

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

Related

Open links from embedded google form in parent window

I can't seem to find an answer to this, since most answers assume you can include an {a href> tag.
I have a google form embedded into Wordpress for customers to submit details. It is embedded using and iframe using the share code from the google form itself.
On the confirmation page after the customer has submitted a response, we have a link for a customer to click to process an order, however this opens our own website again, within the iframe.
I want to open this in the parent window. Is it possible?
NB Google Forms appears to not let me mark up the link. If i put <a href="https://example.com>Click HERE{/a> - it just makes the https://example.com a link within the tag.

Redirecting page changes image request resulting in 404 not found in Next.Js

I have a page called customers in next.Js and another page [id], so it generates the routes /customers and /customers/id.
I wanted to map a list of customers in /customers and if I click on a customer in that list I will be redirected to /customers/id with the information of the customers, this logic is working very well, the problem is when I leave the /customers/id page, for some reason it messes up with some images in my other pages.
I have 2 examples:
example 1: when I try to back to customers page from customers/id it doesn't find my background image from that page, but if I refresh the page it renders normally with the background image.
Example 2: I have a function to validate jwt tokens in a hook and if this token is expired it redirects to the login page, when it does that redirect from customers/id page it doesn't find the background and icon images, but again, if I refresh the page it renders normally, trying to understand that problem I open the console in chrome and realized that when I am redirected from customers/id it changes the request url of the images, all my images are located in public/img, so in my imgs tag I just put '/imagename.jpg' in source, with that all my requests to that images should be "http://localhost:3000/img/imagename.jpg", but with the customers/id redirect that request transforms into "http://localhost:3000/customers/img/imagename.jpg", and for that reason I get the 404 code.
Can someone help me with this issue? Thank you guys for the attention.
SOLVED - I just forgot to put /img in my source, it was img/imgname and I just changed to /img/imgname

Why can't I embed this site in an 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.

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"

Like button on each page

I have a like button on my main page (master page in asp.net).
I added a like button on each dynamic page.
When I try to enter the link:
http://www.friend.co.il/details.aspx?id=2321
to one of the dynamic page in face book developer page:
http://developers.facebook.com/docs/reference/plugins/like/
I get the same number of like as the total site number and not just a number for the specific page.
Any body know whats I'm doing wrong?
Using Facebook's URL Linter on your dynamic page's URL shows that it has Open Graph tags that refer to your website's main page. As a result, Facebook thinks that the canonical URL for http://www.friend.co.il/details.aspx?id=2321 is http://www.friend.co.il/.
You should either remove the meta tags from your subpages, or construct them so that they properly represent the content on each page.
Remove your og:url meta tag and also be sure to not include the Facebook javascript file multiple times like you are currently doing.

Resources