您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add "+" to keywords except numbers, quantifiers, and prepositions on Amazon pages
当前为
// ==UserScript== // @name Amazon Keyword Modifier // @namespace http://tampermonkey.net/ // @version 1.0 // @description Add "+" to keywords except numbers, quantifiers, and prepositions on Amazon pages // @author Your Name // @match https://www.amazon.com/* // @grant GM_setClipboard // ==/UserScript== (function() { 'use strict'; // List of prepositions to exclude const excludedWords = ["for", "in", "on", "at", "by", "to", "of", "with", "about", "as", "from", "into", "over", "under", "after", "before", "around", "through", "between"]; // Create a floating button const button = document.createElement("div"); button.textContent = "+"; button.style.position = "fixed"; button.style.bottom = "20px"; button.style.left = "20px"; button.style.width = "50px"; button.style.height = "50px"; button.style.borderRadius = "50%"; button.style.backgroundColor = "#007bff"; button.style.color = "white"; button.style.fontSize = "24px"; button.style.textAlign = "center"; button.style.lineHeight = "50px"; button.style.cursor = "pointer"; button.style.boxShadow = "0 4px 8px rgba(0, 0, 0, 0.2)"; document.body.appendChild(button); // Create a popup const popup = document.createElement("div"); popup.style.position = "fixed"; popup.style.bottom = "80px"; popup.style.left = "20px"; popup.style.width = "300px"; popup.style.padding = "20px"; popup.style.backgroundColor = "white"; popup.style.border = "1px solid #ccc"; popup.style.boxShadow = "0 4px 8px rgba(0, 0, 0, 0.2)"; popup.style.display = "none"; popup.style.zIndex = "1000"; document.body.appendChild(popup); // Add input box const input = document.createElement("textarea"); input.style.width = "100%"; input.style.height = "60px"; input.placeholder = "Enter keywords here..."; popup.appendChild(input); // Add buttons const copyButton = document.createElement("button"); copyButton.textContent = "Copy"; copyButton.style.marginRight = "10px"; popup.appendChild(copyButton); const clearButton = document.createElement("button"); clearButton.textContent = "Clear"; clearButton.style.marginRight = "10px"; popup.appendChild(clearButton); const closeButton = document.createElement("button"); closeButton.textContent = "Close"; popup.appendChild(closeButton); // Show popup on button click button.addEventListener("click", () => { popup.style.display = popup.style.display === "none" ? "block" : "none"; }); // Add "+" to keywords input.addEventListener("input", () => { const words = input.value.split(/\s+/); const processedWords = words.map(word => { if (/^\d+$/.test(word) || excludedWords.includes(word.toLowerCase())) { return word; } else { return `+${word}`; } }); input.value = processedWords.join(" "); }); // Copy to clipboard copyButton.addEventListener("click", () => { GM_setClipboard(input.value); alert("Copied to clipboard!"); }); // Clear input clearButton.addEventListener("click", () => { input.value = ""; }); // Close popup closeButton.addEventListener("click", () => { popup.style.display = "none"; }); })();