Last active
July 12, 2018 02:28
-
-
Save qnighy/0c622848990004d0bcc894548a9d42ea to your computer and use it in GitHub Desktop.
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 BigQuery auto validate | |
// @namespace https://qnighy.info/ | |
// @version 0.1 | |
// @description saikou | |
// @author Masaki Hara | |
// @match https://bigquery.cloud.google.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let status_box = null; | |
let button = null; | |
let sqlbutton = null; | |
let sqlbuttonlabel = null; | |
setInterval(() => { | |
if(status_box === null) { | |
status_box = document.querySelector(".validate-status-box"); | |
} | |
if(button === null) { | |
button = document.querySelector(".validator-symbol"); | |
} | |
if(sqlbutton === null) { | |
sqlbutton = document.querySelector("#use-legacy-sql"); | |
} | |
if(sqlbuttonlabel === null && sqlbutton !== null) { | |
sqlbuttonlabel = sqlbutton.parentElement.querySelector("label"); | |
} | |
if(status_box != null && button != null && status_box.classList.contains("ng-hide")) { | |
button.click(); | |
} | |
if(sqlbutton != null && sqlbuttonlabel != null && sqlbutton.classList.contains("ng-not-empty")) { | |
sqlbuttonlabel.click(); | |
} | |
}, 5000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment