github.html 581 B

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