Advertisement
Guest User

Untitled

a guest
May 19th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement