Last active
January 11, 2021 16:14
-
-
Save splintor/b51f2b04518b90000faf19765d0c8831 to your computer and use it in GitHub Desktop.
Google Account Chooser - auto select Wix account
This file contains hidden or 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 Account Chooser - auto select Wix account | |
| // @namespace http://splintor.wordpress.com/ | |
| // @version 1.0.4 | |
| // @description Automatically login to your @wix.com account in Google Account Chooser | |
| // @author Shmulik Flint | |
| // @match https://accounts.google.com/signin/* | |
| // @match https://accounts.google.com/AccountChooser* | |
| // @match https://accounts.google.com/o/oauth2/auth* | |
| // @match https://accounts.google.com/o/oauth2/v*/auth* | |
| // @downloadURL https://gist.github.com/splintor/b51f2b04518b90000faf19765d0c8831/raw | |
| // @updateURL https://gist.github.com/splintor/b51f2b04518b90000faf19765d0c8831/raw | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| let timeout = 300; // Minimum time to wait before clicking an account. Without it, Google shows a "Something went wrong" message (but still login). | |
| function clickWixAccount() { | |
| if (document.querySelector('#headingSubtext [data-third-party-email*="@wix"]') || | |
| !document.querySelector('#headingSubtext') || document.querySelector('#headingSubtext').innerHTML === "") { | |
| const wixAccount = document.querySelector('[id*=\\@wix\\.com] button') || document.querySelector('[data-identifier*="@wix.com"]'); | |
| wixAccount && wixAccount.click(); | |
| setTimeout(clickWixAccount, timeout); | |
| timeout = timeout * 2; | |
| } | |
| } | |
| setTimeout(clickWixAccount, timeout); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment