Last active
March 4, 2023 12:14
-
-
Save avin/9fabc1fc1d82ff733a3d718a6b11c579 to your computer and use it in GitHub Desktop.
[TAMPERMONKEY] Only needful languages for AIPRM for ChatGPT
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 Only needful languages for AIPRM for ChatGPT | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @author You | |
// @description try to take over the world! | |
// @match https://chat.openai.com/chat | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function waitForElementToDisplay(elementId, time, cb) { | |
const interval = setInterval(function() { | |
const element = document.getElementById(elementId); | |
if (element) { | |
clearInterval(interval); | |
cb(); | |
} | |
}, time); | |
} | |
const cleanSelect = () => { | |
const select = document.getElementById('languageSelect'); | |
while(true){ | |
let found = false; | |
for (let i = 0; i < select.options.length; i++) { | |
const option = select.options[i]; | |
const value = option.value; | |
if (value !== '' && value !== 'Russian' && value !== 'English') { | |
select.removeChild(option); | |
found = true; | |
} | |
} | |
if(!found){ | |
break; | |
} | |
} | |
select.value = 'Russian'; | |
setTimeout(cleanSelect, 2000); | |
} | |
waitForElementToDisplay('languageSelect', 200, cleanSelect) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment