FB.logout() called without an access token

To logout from the application which uses facebook graph API, use this JavaScript on the logout page just after the <form> tag: window.onload=function() { // initialize the library with your Facebook API key FB.init({ apiKey: ‘b65c1efa72f570xxxxxxxxxxxxxxxxx’ }); //Fetch the status so that we can log out. //You must have the login status before you can … Read more

The resource at “http://some-urls/some-files.js” was blocked because tracking protection is enabled

This feature call Firefox Tracking Protection. Tracking Protection allows Firefox users to avoid many forms of online tracking. Originally based on the blocklist from antitracking startup Disconnect, the feature offers better privacy while also speeding up page loads by blocking requests to tracking domains. How to turn Off Tracking Protection In the Firefox Location bar, … Read more

OmniAuth Strategies Facebook NoAuthorizationCodeError (must pass either a `code` parameter or a signed request (via `signed_request` parameter):

I recently encountered this error when also using the FB JS SDK with omniauth-facebook. I fixed it by sending the signed_request parameter with the GET as shown below: $(document).bind(“fb.loaded”, function() { FB.getLoginStatus(function(response) { console.log(‘FB STATUS: ‘ + response.status); if(response.status == “connected”) { console.log(“FB AUTHED”); location.href=”https://stackoverflow.com/auth/facebook/callback?” + $.param({ signed_request: response.authResponse.signedRequest }) }); } }); }); The … Read more

How to get access token from FB.login method in javascript SDK

You can get access token using FB.getAuthResponse()[‘accessToken’]: FB.login(function(response) { if (response.authResponse) { var access_token = FB.getAuthResponse()[‘accessToken’]; console.log(‘Access Token = ‘+ access_token); FB.api(‘/me’, function(response) { console.log(‘Good to see you, ‘ + response.name + ‘.’); }); } else { console.log(‘User cancelled login or did not fully authorize.’); } }, {scope: ”}); Edit: Updated to use Oauth 2.0, … Read more

Chrome violation : [Violation] Handler took 83ms of runtime

“Chrome violations” don’t represent errors in either Chrome or your own web app. They are instead warnings to help you improve your app. In this case, Long running JavaScript and took 83ms of runtime are alerting you there’s probably an opportunity to speed up your script. (“Violation” is not the best terminology; it’s used here … Read more

Create a file using Javascript in Chrome on client side

Sure you can, using the brand new APIs. window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; window.requestFileSystem(window.TEMPORARY, 1024*1024, function(fs) { fs.root.getFile(‘test.bin’, {create: true}, function(fileEntry) { // test.bin is filename fileEntry.createWriter(function(fileWriter) { var arr = new Uint8Array(3); // data length arr[0] = 97; // byte data; these are codes for ‘abc’ arr[1] = 98; arr[2] = 99; var blob … Read more