0
votes

I get this, when clicking on the like button.

Unsafe JavaScript attempt to access frame with URL http://www.facebook.com/dialog/oauth?api_key=248753205242460&app_id=248753205242460&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Dfedecb848%26origin%3Dhttp%253A%252F%252Flocalhost%252Ff2ad19772%26domain%3Dlocalhost%26relation%3Dparent.parent&client_id=248753205242460&display=none&domain=localhost&locale=en_US&origin=1&redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df99e53428%26origin%3Dhttp%253A%252F%252Flocalhost%252Ff2ad19772%26domain%3Dlocalhost%26relation%3Dparent%26frame%3Df2c40b1914&response_type=token%2Csigned_request%2Ccode&sdk=joey from frame with URL http://www.facebook.com/plugins/like.php?action=like&api_key=248753205242460&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df458cef1c%26origin%3Dhttp%253A%252F%252Flocalhost%252Ff2ad19772%26domain%3Dlocalhost%26relation%3Dparent.parent&colorscheme=light&extended_social_context=false&font=segoe%20ui&href=http%3A%2F%2Fecommercedeveloper.com&layout=standard&locale=en_US&node_type=link&sdk=joey&show_faces=true&width=400#. Domains, protocols and ports must match. Unsafe JavaScript attempt to access frame with URL https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=9#channel=f2ad19772&origin=http%3A%2F%2Flocalhost&channel_path=%2FDummy%2FFBplugin%2Ffb.php%3Ffb_xd_fragment%23xd_sig%3Dfe951f208%26 from frame with URL http://www.facebook.com/plugins/like.php?action=like&api_key=248753205242460&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D9%23cb%3Df458cef1c%26origin%3Dhttp%253A%252F%252Flocalhost%252Ff2ad19772%26domain%3Dlocalhost%26relation%3Dparent.parent&colorscheme=light&extended_social_context=false&font=segoe%20ui&href=http%3A%2F%2Fecommercedeveloper.com&layout=standard&locale=en_US&node_type=link&sdk=joey&show_faces=true&width=400#. Domains, protocols and ports must match.

I dont know why I get that error, it could be because the code that checks the login is triggered..

This my html:

<!DOCTYPE html>

<body>
  <div id="fb-root"></div>

       <script type="text/javascript">
 $(document).ready(function(){          

          FB.init({
            appId      : '248753205242460', // App ID
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            xfbml      : true  // parse XFBML
            });   



window.fbAsyncInit = function() {
            console.log('Sdk is loaded');


FB.getLoginStatus(function(response) {
                console.log('GEtting logged in status');

  if (response.status === 'connected') {
    // the user is logged in and has authenticated your
    // app, and response.authResponse supplies
    // the user's ID, a valid access token, a signed
    // request, and the time the access token 
    // and signed request each expire
    var uid = response.authResponse.userID;
    console.log('User is connected');
    var accessToken = response.authResponse.accessToken;
  } else if (response.status === 'not_authorized') {
    // the user is logged in to Facebook, 
    // but has not authenticated your app
     console.log('User not authorized');
  } else {
    // the user isn't logged in to Facebook.
     console.log('User inst logged in');
  }
 });
};



 FB.Event.subscribe('edge.create',
    function(response) {
        console.log('You liked the URL: ' + response.status);
    });

});





       </script>        
    </body>
</html>
2
did you check that; is your facebook application's sandbox mode off? - Barlas Apaydin
and did you make sure you have a fb-root element on the page - The JavaScript SDK requires the fb-root element in order to load properly and a call to FB.init to initialize the SDK with your app ID correctly. developers.facebook.com/docs/reference/javascript - mraaroncruz
To tell you the truth I cant go into the facebook developers pages.. dont know why..wont let me. see update - Dmitry Makovetskiyd
I think I need to have my own app id... can it be the cause? it is my facebook name and not a number - Dmitry Makovetskiyd

2 Answers

1
votes

The other event that I am using is "getLoginStatus", which will show me if the user is logged in to facebook or not..

That’s not an “event” in itself – it’s just an asynchronous method, and it gets you the login status.

console.log('FB.getLoginStatus: '+FB.getLoginStatus);

At this point you are not even calling the method – you are just stating it’s name. (I know, you’re calling it before – but this debug output does not make much sense.)

I want to trigger edge.create

How exactly did you implement your like button? This event is not fired if you’re using the iframe version of the button.

[from comments] I think I need to have my own app id... can it be the cause? it is my facebook name and not a number

Of course you do. Your user name is not an app id in any way.

1
votes

The error messages Unsafe JavaScript attempt to access frame with URL and Domains, protocols and ports must match usually imply that your http protocols are faulty. Should you be using HTTPS for these calls instead of normal HTTP?

when i see these errors i usually test out if i'm missing an https somewhere...

Also see if your app has all it's secure URLs set up in the developer management panel on facebook!