Cannot load Facebook SDK for JavaScript v 2.4 in chrome extension

319 views
Skip to first unread message

Manojit Ghosh

unread,
Aug 28, 2015, 3:37:11 AM8/28/15
to Chromium-extensions

I am trying to display a like and a share button in side my chrome extension's popup.html. So, I have added the sdk code in facebook-2.4.js and loaded it in the head tag of popup.html. I tried to test Facebook Integration by putting this code in the body of my popup.html:

<div
  class="fb-like"
  data-share="true"
  data-width="450"
  data-show-faces="true">
</div>

But, I got this error in chrome console:

Failed to load resource: net::ERR_FAILED 
chrome-extension://connect.facebook.net/en_US/sdk.js

Here's what I tried: In the manifest I added https://connect.facebook.net/ as permission. I also tried with the http version of the url. It didn't work.

Timo Reimann

unread,
Aug 30, 2015, 5:13:10 AM8/30/15
to Chromium-extensions
I haven't looked into the documentation, but maybe you need to append an asterisk to the host pattern in order to match the full path of the SDK URL.

What I'd rather consider though is just downloading the SDK once and have it loaded from disk. That way, you're isolating yourself from one source of failure and avoid potential slow downs in page loading.

If that's not possible for you for whatever reason, and tuning the host pattern isn't helping, I'd suggest to post a full example in order to ease debugging and reproducibility for others on the list trying to help you.

Reply all
Reply to author
Forward
0 new messages