Добавить nyakonya_nmscr/script.user.js
This commit is contained in:
@@ -0,0 +1,82 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name Nude-Moon скрипт
|
||||||
|
// @namespace nyakonya_nmscr
|
||||||
|
// @match https://*.nude-moon.fun/*
|
||||||
|
// @match https://nude-moon.fun/*
|
||||||
|
// @match https://*.nude-moon.org/*
|
||||||
|
// @match https://nude-moon.org/*
|
||||||
|
// @version 0.1.2b
|
||||||
|
// @author https://t.me/Nyako_TW
|
||||||
|
// @description 15.07.2023, 19:46:44
|
||||||
|
// @license Apache License 2.0
|
||||||
|
// @downloadURL https://git.nekono.su/Nyako/script-dev-ru/raw/branch/main/nyakonya_nmscr/script.user.js
|
||||||
|
// @updateURL https://git.nekono.su/Nyako/script-dev-ru/raw/branch/main/nyakonya_nmscr/script.user.js
|
||||||
|
// @grant GM_registerMenuCommand
|
||||||
|
// @grant GM_getValue
|
||||||
|
// @grant GM_setValue
|
||||||
|
// @compatible tampermonkey
|
||||||
|
// @compatible violentmonkey
|
||||||
|
// @incompatible greasemonkey
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
// Фунция безопасного запуска функций
|
||||||
|
function safeRun(fn, name) {
|
||||||
|
try {
|
||||||
|
fn();
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Ошибка в ${name}:`, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Фунции генерации конфигураций
|
||||||
|
function registerToggle(key, defaultValue, title, enabledText, disabledText) {
|
||||||
|
const isEnabled = GM_getValue(key, defaultValue);
|
||||||
|
|
||||||
|
const menuText = `${isEnabled ? '✅' : '🔲'} ${title}`;
|
||||||
|
|
||||||
|
GM_registerMenuCommand(menuText, () => {
|
||||||
|
const newState = !isEnabled;
|
||||||
|
|
||||||
|
GM_setValue(key, newState);
|
||||||
|
|
||||||
|
alert(
|
||||||
|
`Настройка изменена! ${title} ${
|
||||||
|
newState ? enabledText : disabledText
|
||||||
|
}. Обновите страницу для применения настроек.`
|
||||||
|
);
|
||||||
|
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Генерация конфигураций
|
||||||
|
function config_runner() {
|
||||||
|
registerToggle(
|
||||||
|
'nyakonya_nmscr_car',
|
||||||
|
false,
|
||||||
|
'Карусель',
|
||||||
|
'включена',
|
||||||
|
'выключена'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove_car() {
|
||||||
|
if (window.location.pathname == "/") {
|
||||||
|
CarisEnabled = GM_getValue('nyakonya_nmscr_car', false);
|
||||||
|
if (!CarisEnabled){
|
||||||
|
document.getElementsByClassName("owl-carousel")[0].remove();
|
||||||
|
tmp1_list = document.getElementsByClassName("bg_style1");
|
||||||
|
for (let one_tmp1 of tmp1_list) {
|
||||||
|
if (one_tmp1.innerText.includes("Случайные переводы")) {
|
||||||
|
one_tmp1.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Запуск основных функций
|
||||||
|
safeRun(config_runner, "config_runner");
|
||||||
|
safeRun(remove_car, "remove_car");
|
||||||
Reference in New Issue
Block a user