github.html 625 B

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. </head>
  6. <body>
  7. This window will be closed automatically.
  8. <script>
  9. if (window.opener != null && window.opener.onGitHubCallback != null)
  10. {
  11. try
  12. {
  13. var search = window.location.search;
  14. var idx1 = search.indexOf('code=');
  15. var code = null;
  16. if (idx1 >= 0)
  17. {
  18. code = search.substring(idx1 + 5);
  19. }
  20. // Continues execution of main program flow
  21. window.opener.onGitHubCallback(code, window);
  22. }
  23. catch (e)
  24. {
  25. alert('GitHub: ' + e.toString());
  26. window.close();
  27. }
  28. }
  29. </script>
  30. </body>
  31. </html>