pitchtarget / ember-cli-facebook-js-sdk

Simple Facebook SDK for Javascript addon for your Ember CLI app.
MIT License
29 stars 15 forks source link

Firefox private mode issues #33

Open gordonbisnor opened 6 years ago

gordonbisnor commented 6 years ago

I had originally set up facebook init in our application route as per the README:

beforeModel() {
  return this.get('fb').FBInit();
}

But my client noticed that our site now does no work in Firefox private mode, which I realized was a result of adding this library. Firefox is blocking the Facebok init.. So I have changed our code to this:

  beforeModel() {
    this.get('fb').FBInit().then(ok=>ok).catch(()=>true);
  }

This at least lets the bulk of our site load, but we have a remaining issue of Facebook sharing buttons that do not work in Firefox private mode.

I'm posting this issue as a general heads up, and wondering if this library has a way to check on the status of FBInit, or if anyone has any advice on how to work around this –– eg so that I can not show facebook share buttons if they are not going to work when clicked...

gordonbisnor commented 6 years ago

Hm I can't find anything within the library to easily check status of fb init. Seems like it would be ideal to have a property on the service that would indicate status. I could try to work on a PR if you like if something does not already exist that handles this scenario, let me know!

bugant commented 5 years ago

@gordonbisnor sorry I miss the notification for your issue. Are you still interested?

One workaround could be to check for , window.fbAsyncInit.hasRun see: https://github.com/pitchtarget/ember-cli-facebook-js-sdk/blob/master/addon/services/fb.js#L49