您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Execute UserScript
// ==UserScript== // @name site:で原神wikiに飛ぶ(スマホ対応) // @namespace http://tampermonkey.net/ // @version 1.3 // @description Execute UserScript // @author Your Name // @include https://gamewith.jp/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let selectedText = ""; // 選択テキストを保存 // タップ時にも選択テキストを取得できるようにする document.addEventListener("mouseup", () => { selectedText = window.getSelection().toString().trim(); }); document.addEventListener("touchend", () => { selectedText = window.getSelection().toString().trim(); }); const button = document.createElement('div'); button.style.position = 'fixed'; button.style.top = '15px'; button.style.left = '150px'; button.style.width = '40px'; button.style.height = '40px'; button.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; button.style.color = 'white'; button.style.borderRadius = '8px'; button.style.cursor = 'pointer'; button.style.zIndex = '10000'; button.style.display = 'flex'; button.style.alignItems = 'center'; button.style.justifyContent = 'center'; button.style.fontSize = '14px'; button.innerText = '🔍'; button.addEventListener('click', () => { const siteName = "wikiwiki.jp"; if (selectedText) { const query = encodeURIComponent(`site:${siteName} ${selectedText}`); window.open(`https://www.google.com/search?q=${query}`, "_blank"); } else { alert("検索する文字を選択してください"); } }); document.body.appendChild(button); })();