Skip to content

Instantly share code, notes, and snippets.

@omarrr
Created March 25, 2014 18:43
Show Gist options
  • Save omarrr/9768436 to your computer and use it in GitHub Desktop.
Save omarrr/9768436 to your computer and use it in GitHub Desktop.
Bookmarklet: Add Facebook App to Facebook Page
/*
Bookmarklet Ready Code:
javascript:(function(){var h=document.location.href;var regex=/http(s?)\:\/\/developers\.facebook\.com\/x\/apps\/(\w*)/;var appid=h.match(regex)[2];var u='https://www.facebook.com/dialog/pagetab?redirect_uri=http://www.facebook.com/&app_id='+appid;window.location.href=u;})();
*/
var h = document.location.href;
var regex = /http(s?)\:\/\/developers\.facebook\.com\/x\/apps\/(\w*)/;
var appid = h.match(regex)[2];
var u = 'https://www.facebook.com/dialog/pagetab?redirect_uri=http://www.facebook.com/&app_id='+appid;
window.location.href = u;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment