https://accounts.google.com/signin/oauth/oauthchooseaccount shows up when sync is starting (usually when browser is started), it seems to remember the auth data for like hour or so.
This URL should not open each time browser is started.
Mentioned URL opens almost every time browser starts.
From all extensions I'm using with Google Drive sync only Tempermonkey is having this issues.
(reddit enhanced, stylus)
I've already tried revoking access through the extension and Google Drive (with data wipe) as well as clean installing the extension without any success.
I've tried using this script I found while searching for solution but it doesn't work at all (doesn't show up as active script on that page):
// ==UserScript==
// @name Sync fix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*.google.com/*/oauthchooseaccount*tampermonkey*
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.querySelector('div[data-authuser="0"]').click();
window.close();
})();
Remaining scripts working?
Remaining scripts working?
What do you mean? Posted script doesn't work on that page even though it should.
Scripts on other pages.
Everything is working fine on other pages
The issue stopped happening now randomly, I'll close this off for now since there is no way to investigate this currently.
Seems like the issue is back and resetting no longer works, now each time first attempt to authorize shows Google's "something went wrong page" and after clicking "Next" it ends up as "400. That's an error.'.
I was able to get rid of it after repeatedly revoking and resetting sync over and over again until it stopped asking me for auth on browser launch... but the bug is still there so I'm leaving this open.
Currently using this workaround script (it automatically clicks first account):
// ==UserScript==
// @name Google Drive sync fix
// @version 0.1.0
// @author jacklul <jacklul.github.io>
// @match https://accounts.google.com/signin/oauth*tampermonkey*
// ==/UserScript==
(function() {
'use strict';
let tryClick = setInterval(function() {
const el = document.querySelector('div[data-authuser="0"] #profileIdentifier');
if (el) {
const isBusy = document.querySelector('div[role="presentation"][tabindex="-1"]');
const hasBackButton = document.querySelector('div[role="button"]#next');
if (isBusy) {
console.log('Page is busy...');
}
// Close page if there was "unknown error"
if (hasBackButton) {
window.close();
}
// Try clicking until page gets busy
if (!isBusy) {
console.log('Clicking...');
el.click();
}
}
}, 500);
})();
Thanks @jacklul, that script seems very useful. I have uploaded it here, so it's easy for people to install:
https://openuserjs.org/scripts/joeytwiddle/Tampermonkey_Google_Drive_sync_fix