s9e / s9e.github.io

10 stars 3 forks source link

XenForo facebook media embeds broken when Firefox Facebook Container is enabled #3

Closed wolfpld closed 3 years ago

wolfpld commented 3 years ago

Mozilla provides an addon for Firefox, which blocks access to everything facebook related (i.e. facebook.com, instagram.com, messenger.com, etc.) during normal browsing to protect user's privacy. Accessing these sites is still possible, for example by directly going to facebook.com, but everything there is running in a container, keeping it separate from all other web pages and their data.

https://addons.mozilla.org/firefox/addon/facebook-container/

When s9e Media Sites addon is enabled on XenForo, it hijacks the original link to facebook and replaces it with an iframe containing https://s9e.github.io/iframe/2/facebook.min.html, which in turn loads a script from https://connect.facebook.net/en_US/sdk.js, which is blocked, which results in "Cannot load Facebook SDK. Disable any adblocker or tracking protection and try again." error message.

This is fully expected, as with the Facebook Container there should be no facebook content present on any non-facebook page. However, in such setup the user has no way of obtaining the original link to the facebook page that was posted, so that he could see the content.

Would it be possible to include a direct link to the appropriate facebook page next to the error message? This would solve the issue.

JoshyPHP commented 3 years ago

The only information available to the iframe's page is the ID of the Facebook post. If there's a way to create a URL solely with that ID, I will consider replacing the error message with a link to the original post. However, I don't think that Facebook supports that kind of permalinks anymore.

The solution might just be to configure your XenForo forums to add a link below embedded media. There's an option for it in the media site settings. Do note that the link can only be added at the time the URL is posted.

I'm closing this issue for now but do feel free to reopen if you discover a way to recreate the original URL based on the post's ID.

wolfpld commented 3 years ago

Thanks for the quick response! I'm only an user of the forum, not an admin though. Can you show me the exact option that has to be enabled for links to be added, so I can forward it to the responsible person?

JoshyPHP commented 3 years ago

The setting is called autoEmbedMedia, it can be found via the admin panel's search box.

wolfpld commented 3 years ago

Thanks!