ggtcallback.html 708 B

1234567891011121314151617181920212223242526272829
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6. <script>
  7. function getURLParameter(name) {
  8. return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
  9. }
  10. function sendToken() {
  11. window.opener.postMessage(JSON.stringify({action: "logintoken", msg: getURLParameter("token")}), "*");
  12. }
  13. function sendURL() {
  14. window.opener.postMessage(JSON.stringify({action: "openfromggt", msg: getURLParameter("url")}), "*");
  15. }
  16. if (getURLParameter("token") !== null) {
  17. sendToken();
  18. }
  19. if (getURLParameter("url") !== null) {
  20. sendURL();
  21. }
  22. </script>
  23. </body>
  24. </html>