Skip to content

Instantly share code, notes, and snippets.

@Duologic
Created January 27, 2024 18:34
Show Gist options
  • Save Duologic/f09027da253c6efd3e09a8580e9aa588 to your computer and use it in GitHub Desktop.
Save Duologic/f09027da253c6efd3e09a8580e9aa588 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Hit sign-in button on Drone
// @description Hit sign-in button on Drone
// @version 1.0
// @namespace https://drone.grafana.net
// @match https://drone.grafana.net/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
var waitForThatFrickingButton1 = setInterval(function() {
let xpath = "//span[text()='Sign In']";
let button = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if(button) {
button.click();
clearInterval(waitForThatFrickingButton1);
}
}, 500)
var waitForThatFrickingButton2 = setInterval(function() {
let xpath = "//span[text()='Continue']";
let button = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if(button) {
button.click();
clearInterval(waitForThatFrickingButton2);
}
}, 500)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment