Skip to content

Instantly share code, notes, and snippets.

@bclswl0827
Created May 22, 2023 12:18
Show Gist options
  • Save bclswl0827/94688098495b5b58a1146e40170c4b13 to your computer and use it in GitHub Desktop.
Save bclswl0827/94688098495b5b58a1146e40170c4b13 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Bypassing KiwiSDR extension restrictions
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author ttyUSB0
// @run-at document-end
// @match *
// @icon https://www.google.com/s2/favicons?sz=64&domain=kiwisdr.com
// ==/UserScript==
const isKiwiSDR = () => {
const app = document.querySelector(".id-kiwi-body");
if (app) {
return true;
}
return false;
};
const waitForElement = (selector) => {
return new Promise((resolve) => {
let observer;
const createObserver = () => {
observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (document.querySelector(selector)) {
observer.disconnect();
resolve();
}
});
});
const config = {
childList: true,
subtree: true,
attributes: true,
characterData: true
};
observer.observe(document.documentElement, config);
};
createObserver();
});
}
const removeDisabled = (selectEl) => {
for (let i of selectEl.options) {
if (i.value !== "-1" && i.disabled) {
i.disabled = false;
}
}
}
async function main() {
await waitForElement("#id-select-ext");
const targetEl = document.querySelector("#id-select-ext");
removeDisabled(targetEl);
}
if (isKiwiSDR) {
main();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment