Skip to content

Instantly share code, notes, and snippets.

@splintor
Last active May 4, 2026 08:26
Show Gist options
  • Select an option

  • Save splintor/d2c656cf8759a90df981113041d759c1 to your computer and use it in GitHub Desktop.

Select an option

Save splintor/d2c656cf8759a90df981113041d759c1 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Claude - handle authentication
// @namespace Shmulik's Scripts
// @match http://127.0.0.1:*/callback*
// @downloadURL https://gist.githubusercontent.com/splintor/d2c656cf8759a90df981113041d759c1/raw
// @updateURL https://gist.githubusercontent.com/splintor/d2c656cf8759a90df981113041d759c1/raw
// @icon
// @grant window.close
// @version 1.0
// @author shmulikf@wix.com
// ==/UserScript==
(function () {
function closeSuccessfulAuthentication() {
const h1 = Array.from(document.querySelectorAll('h1'))
.find(el => el.textContent.trim() === 'Authentication Successful');
if (h1) {
clearInterval(interval);
window.close();
}
}
const interval = setInterval(closeSuccessfulAuthentication, 500);
closeSuccessfulAuthentication();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment