您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Speichert und lädt Kommentartexte im MyDealz-Editor mit Strg+S und Strg+L
// ==UserScript== // @name MyDealz Kommentar-Editor Speichern/Laden // @namespace http://tampermonkey.net/ // @version 1.1 // @description Speichert und lädt Kommentartexte im MyDealz-Editor mit Strg+S und Strg+L // @author Claude 3.5 Opus // @match https://www.mydealz.de/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Funktion zum Speichern des Kommentartextes function saveComment(event) { if (event.ctrlKey && event.key === 's') { event.preventDefault(); const articleId = getArticleId(); const commentText = document.querySelector('.redactor-editor').innerHTML; localStorage.setItem(`comment_${articleId}`, commentText); } } // Funktion zum Laden des Kommentartextes function loadComment(event) { if (event.ctrlKey && event.key === 'l') { event.preventDefault(); const articleId = getArticleId(); const commentText = localStorage.getItem(`comment_${articleId}`); if (commentText) { document.querySelector('.redactor-editor').innerHTML = commentText; } } } // Funktion zum Extrahieren der Artikel-ID aus der URL function getArticleId() { const url = window.location.href; const match = url.match(/-(\d+)/); return match ? match[1] : null; } // Event-Listener für Tastatureingaben hinzufügen document.addEventListener('keydown', saveComment); document.addEventListener('keydown', loadComment); })();