SHARE
TWEET

Untitled

a guest May 19th, 2013 140 Never
  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. }
RAW Paste Data
Top