Facebook share from within an Iframe which directs to a Parent page - javascript

We have parent page with an Iframe in it.
We want people to use a Facebook share button (using Addthis.com) within the iframe, and that the share will:
Get the parent page URL, and link the share to the father page
Will get the title, description and thumbnail from the iframe page
I understand Facebook Open Graph can help but dont know how.

Related

Is there a way to track user navigation inside iframe

I wanted to know the url the user visited inside a iframe tag
I know it need same origin policy doesn't allows it
Is there a way to achieve this?
For eg: I have a website inside which I used ifame to show another website I wanted to know what pages of another website user visits inside iframe tag website

How to get links in an iframe I don't control to open in parent window

Is this even possible?
Background
I have a page that's basically just a logo and an iframe.
I have complete control over the parent page and can use whatever tricks I want (html, javascript, php, etc.).
The page in the iframe, however, is a third party page that I have very little control over. I can use no javascript, no css, I can't even modify any links. All I can do is modify some text.
Problem
I only need the logo on the initial page. Once the user logs in or clicks to a different page, I want that new page to open in the parent window. I know about target="_top" and target="_parent", but those won't help me because I have no real access to the links in the iframe.
Question
Is there any attribute I can put on the iframe or javascript I can use in the parent page that will force new pages in the iframe to load in the parent window?

Render dynamic content in iframe base on parent

I want to display my website in iframe of other domain(s). When displayed in iframe of that domain, I want to perform some actions like hiding/displaying content. Pages from my website are also iframed in same domain as well. So there is dynamic behavior. How do I find out where is my page iframed? There will be navigations from one page to another in iframe and whenever full page load happens, I want to know the context/parent where my page is iframed.
Using postMessage is not an option because it is async and I don't have control over other domains/apps. I found out iframe name can be accessed from following question -
access iframe name from inside iframe
Can I use it to find out the iframe context. (I can ask other domains/apps to set particular name to iframe so that they get correct rendering of the page)

How to redirect to parent window after logging in from iframe window?

I am using an Iframe window to display the login form of another website. And what I want is the user should go to that particular site after logging in(even if logging in fails, any click on any link in that iframe should take the user to that site in the full window(parent window).
As long as the links (within the iFrame) are part of the other page, you can't "hijack" their target. You would have to have the means and ability to modify the target attribute of each link to point to _parent or use javascript to reference the window.parent.
Based on what you're saying (you're logging in to a different domain and the page is not part of your site) this wouldn't be possible without implementing some kind of proxy where you could modify the contents between page visits.

OpenjQuery Fancybox Lightbox automatically in Rails

I am using Fancybox to open up content in an iframe on my page, and it is working great.
This content has a share bar in it however, and when you click on the link posted on social media, it takes you directly to the content without opening it in an iframe, so the layout is all screwy.
I want to be able to either do:
If the user goes directly to the link, redirect to the homepage and open in an iframe
Give the user an alternate layout if the link is clicked from a link that doesn't have class="iframe"
I am using Rails 3 to build my site, and I found this post about opening the content in an iframe automatically, the problem is if a user clicks on the link on my site (with class="iframe") it opens an iframe within the iframe!
Is there a good workaround for this?
Does this make sense?
Thanks!!
In javascript you can check to see if the page is already in an iframe
var isInIFrame = (window.location != window.parent.location) ? true : false;
You can do this check onclick to decide whether or not to load the content in an iframe.
Is this helpful? I'm not sure that I completely understand the question.

Categories

Resources