您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Rajoute un bouton pour afficher/masquer la Chatbox
// ==UserScript== // @name Forum WS - Bouton pour afficher/masquer la Chatbox // @namespace Forum-WS // @version 1.0.4 // @description Rajoute un bouton pour afficher/masquer la Chatbox // @author Micdu70 // @match https://www.wareziens.net/forum* // @match https://wareziens.net/forum* // @match http://www.wareziens.net/forum* // @match http://wareziens.net/forum* // @grant GM_getValue // @grant GM_setValue // @grant GM.getValue // @grant GM.setValue // ==/UserScript== function GM_polyfill() { if(typeof GM == 'undefined') { this.GM = {}; } } function getValue(x) { if(typeof GM.getValue == 'undefined') { return GM_getValue(x); } else { return GM.getValue(x); } } function setValue(x,y) { if(typeof GM.setValue == 'undefined') { GM_setValue(x,y); } else { GM.setValue(x,y); } } function INIT() { var chatbox = document.getElementById('idx1'); if (chatbox) { GM_polyfill(); var button = document.createElement('input'); button.setAttribute('id', 'cbButton'); button.setAttribute('type', 'button'); (async () => { let hit = await getValue("hide"); if (hit) { button.setAttribute('value', 'Afficher la Chatbox'); chatbox.style.display = "none"; } else { button.setAttribute('value', 'Masquer la Chatbox'); } chatbox.parentNode.insertBefore(button, chatbox); document.getElementById('cbButton').onclick = function() { if (!hit) { button.setAttribute('value', 'Afficher la Chatbox'); chatbox.style.display = "none"; hit = 1; setValue("hide", true); } else { button.setAttribute('value', 'Masquer la Chatbox'); chatbox.style.display = "block"; hit = 0; setValue("hide", false); } }; })(); } } INIT();