No_texte_conserve

Ne sauvegarde pas la zone de texte au rechargement de page

目前為 2025-06-01 提交的版本,檢視 最新版本

// ==UserScript==
// @name         No_texte_conserve
// @namespace    Notexteconserve
// @version      0.01.1
// @description  Ne sauvegarde pas la zone de texte au rechargement de page
// @author       Atlantis
// @icon         https://images.emojiterra.com/google/noto-emoji/unicode-16.0/color/128px/1f4cb.png
// @match        *://www.jeuxvideo.com/forums/*
// @license      MIT
// ==/UserScript==

//strikesessionstorage();

//attendre_le_dom_JVC_2.0
if (document.querySelector('.messageEditor__buttonEdit')) {
    maincl();
} else {
    setTimeout(() => {
        if (document.querySelector('.messageEditor__buttonEdit')) {
            maincl();
        }
    }, 500);
}

function maincl() {
    resetTextFields(); //vide la zone de texte quand actualisé
}

// vide la zone de texte en actualisant
function resetTextFields() {
    var textField1 = document.getElementById('message_topic');
    if (textField1) {
        //textField1.value = '';
        Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")
          .set.call(textField1, '');
        textField1.dispatchEvent(new Event("input", { bubbles: true }));
    }
}


//ne sert a rien mais on anticipe
function strikesessionstorage(url = window.location.href) {
    const topicid = (location.href.match(/forums\/\d+-\d+-(\d+)-/) || [])[1];
    if (topicid) {
        sessionStorage.removeItem(`savedMessage:topicId:${topicid}`);
    }
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址