0

I have added the code to show the facebook like and share buttons in my website. It works with Chrome and Firefox but it doesn't show up with Microsoft Edge and any version of Internet Explorer.

Here is my code:

<div id="fb-root"></div><script language="javascript" type="text/javascript">(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/it_IT/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><script language="javascript" type="text/javascript">//<![CDATA[ document.write('<fb:like href="https://www.facebook.com/mypage/" width="500" colorscheme="light" show_faces="true" font="tahoma" send="true" layout="standard" action="like"></fb:like> '); //]]> </script>

[Note: for privacy reasons in this snippet I have replaced the real facebook page with "mypage".]

The facebook plugin, when this script is executed, places an iframe in the html. The html document inside the iframe is completely empty with Edge and IE, while in the other browsers it contains the like button.

If I open the file inspector with Edge, I find this warning for this iframe:

'iframe[allow]' is not supported by Firefox for Android.

By the way this warning is a bit odd because it is thrown by Edge browser on a Windows Desktop (not on Firefox or on android).

How can I fix it?

5
  • Do the restrictions mentioned in the plugin documentation, regarding users in the European region, apply in your test setting? If so, have you fulfilled the conditions?
    – CBroe
    Commented Feb 28, 2023 at 11:00
  • You are on the right track. I changed my IP address to USA with a VPN and the button is displayed. How can circumvent this? May I allow any IP address in the settings of the facebook page?
    – A. Amori
    Commented Feb 28, 2023 at 12:15
  • No, you can not do anything with IP addresses here. Just make sure you are fulfilling the conditions, when you are testing ...? "unless they are both 1) Logged into their Facebook account, and 2) have provided consent to the “App and Website Cookies” control. If both of these requirements are met, the user will be able to see and interact with plugins such as the 'Like' or 'Comment' button. If either of the requirements above are not met, the user will not be able to see the plugins." - so make sure that you are logged-in to Facebook in your test browser, and provide the consent.
    – CBroe
    Commented Feb 28, 2023 at 12:19
  • The matter is clear and I don't need to do more testing. I need that the button is shown to the people that have a facebook account, and that are not logged a that moment, which is the 99% of the incoming users
    – A. Amori
    Commented Feb 28, 2023 at 13:20
  • Well that is of course not possible.
    – CBroe
    Commented Feb 28, 2023 at 13:24

1 Answer 1

0

It has resulted that the plugin is blocked by Facebook for European users that are not logged in Facebook or haven't "provided consent to the “App and Website Cookies” control". See https://developers.facebook.com/docs/plugins/like-button/ When I wrote this post I wrongly wrote that the problem was not present with Chrome and Firefox. Now I realized that I was logged in in Facebook with these browsers. If I log out, the behavior is the same with all browsers. In conclusion, a technical solution doesn't exist, and even if it existed possibly it would be illegal.

Not the answer you're looking for? Browse other questions tagged or ask your own question.