// ==UserScript== // @name SignON // @version 0.2.0 // @description Affiche ta signature sur Onche.org // @author RisiOnche // @match https://onche.org/topic/* // @match https://onche.org/account/profil // @icon https://www.risishack.com/po8c1f.png // @updateURL https://codeberg.org/GalileoR/RisiOncheScripts/raw/branch/main/signon.user.js // @downloadURL https://codeberg.org/GalileoR/RisiOncheScripts/raw/branch/main/signon.user.js // @grant GM_setValue // @grant GM_getValue // ==/UserScript== function escapeRegex(string) { return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&'); } (function () { 'use strict'; const pseudo = document.querySelector('.account > span')?.innerHTML; const storageKey = `sign-${pseudo}`; const storageKeyShowSign = "showSign"; let signature = GM_getValue(storageKey) || ''; let showSign = GM_getValue(storageKeyShowSign, true); const url = window.location.href; //if(url.includes('#last')) url = `${url}#last`; const form = document.querySelector(`form[action="${url}]`); document.querySelector('.button.medium.filled.right')?.addEventListener('click', () => { if (signature) document.querySelector('textarea[name="message"]').value += "\n\n[i]~[u]Signature[/u][/i]~" + signature; }); if (url === "https://onche.org/account/profil") { const newBlock = `