Make Facebook sharing button work in iframe and share parent url with iframe meta tags

I am working on a quiz embeddable widget. Say we have an iFrame quiz page http://page.com/quiz, iframe src is http://quizes.com/quizes/1. I use this JS code to activate the Facebook share button:

FB.ui({
  method: 'share',
  href: 'http://quizes.com/quizes/1?result_id=2'
});

In http://quizes.com/quizes/1?result_id=2render og:title, og:descriptionand og:imagebased on the result of the user. The fact is that if the survey is embedded in the Facebook post, I want to see the parent domain ( page.com), but this is quizes.com(gistroll.com- real project domain).

enter image description here

URL- , : http://quizes.com/quizes/1?result_id=2&url=http://page.com/quiz url og:url, Google Crawler http://page.com/quiz , , .

. , Facebook? ( , JS?)

+4

Source: https://habr.com/ru/post/1548540/


All Articles