Google Play Become a Tester

Automatically refresh the Google Play “Become a Tester” page and join as a beta tester when the tester quota becomes available.

  1. // ==UserScript==
  2. // @name Google Play Become a Tester
  3. // @version 0.4
  4. // @namespace https://isab.run/
  5. // @description Automatically refresh the Google Play “Become a Tester” page and join as a beta tester when the tester quota becomes available.
  6. // @author Joe Fang
  7. // @license MIT
  8.  
  9. // @match https://play.google.com/apps/testing/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=play.google.com
  11. // ==/UserScript==
  12.  
  13. "use strict";
  14.  
  15.  
  16. (() => {
  17. const getJoinButton = () => {
  18. const button = document.querySelector('input[type="submit"]')
  19. if (button && button.value && button.value.trim().toLowerCase() === 'become a tester') {
  20. return button
  21. }
  22. return undefined
  23. }
  24.  
  25. const getLeaveButton = () => {
  26. const button = document.querySelector('input[type="submit"]')
  27. if (button && button.value && button.value.trim().toLowerCase() === 'leave the program') {
  28. return button
  29. }
  30. return undefined
  31. }
  32.  
  33. if (getLeaveButton()) {
  34. return;
  35. }
  36.  
  37. let button = getJoinButton();
  38. console.log('Button', button)
  39. if (!button) {
  40. setTimeout(() => location.reload(), 30000.0)
  41. console.log('Time:', (new Date()).toLocaleString(), '; Refreshing', location.href, 'in 30 seconds');
  42. return
  43. }
  44.  
  45. button.click()
  46. })()