Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 19th, 2013  |  syntax: None  |  size: 0.84 KB  |  views: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if (document.location.protocol=='http:'){
  2.   document.location.protocol = 'https:';
  3. }
  4.        
  5. if (document.location.protocol=='http:'){
  6.   window.top.location = 'https://YOUR_APPLICATION_PAGE_URL'
  7. }
  8.        
  9. if (document.location.protocol=='http:'){
  10.   var applicationUrl = 'https://facebook.com/example-application';
  11.   var canvasURL = 'http://example.com/facebook-canvas';
  12.   var currentAppPageUrl = (document.location+'').replace(canvasURL, applicationUrl);
  13.   window.top.location = currentAppPageUrl;
  14. }
  15.        
  16. if (document.location.protocol=='http:'){
  17.     var applicationUrl = 'https://facebook.com/example-application';
  18.     var canvasURL = location.protocol+'//'+location.host+location.pathname;
  19.     var currentAppPageUrl = (document.location+'').replace(canvasURL, applicationUrl);
  20.     try {
  21.         window.top.location = currentAppPageUrl;
  22.     } catch (e) {
  23.     }
  24. }