Created
May 24, 2015 13:09
-
-
Save Terrance/05cf35cdd5b4b3cac152 to your computer and use it in GitHub Desktop.
A userscript to set the current Google account (according to `?authuser=`) when joining and leaving tests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Play Testing per-account | |
// @namespace http://terrance.uk.to | |
// @version 0.1 | |
// @description Makes the "Become a Tester" button respect the current auth user. | |
// @author Ollie Terrance | |
// @match https://play.google.com/apps/testing/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
var au = location.search.match(/authuser=([0-9])/); | |
if (au) { | |
var jf = document.getElementsByClassName("joinForm"); | |
if (jf.length) jf[0].action += "?" + au[0]; | |
var lf = document.getElementsByClassName("leaveForm"); | |
if (lf.length) lf[0].action += "?" + au[0]; | |
var as = document.getElementsByTagName("a"); | |
for (var i in as) { | |
if (as[i].href && as[i].href.match(/details\?id=/)) as[i].href += "&" + au[0]; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment