您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Google Geminiで「新しいチャットを作成」ダイアログを自動で確認し、通知を表示します。
// ==UserScript== // @name Auto Confirm New Chat for Gemini // @namespace https://qestir.hatenablog.com/ // @version 1.1 // @description Google Geminiで「新しいチャットを作成」ダイアログを自動で確認し、通知を表示します。 // @match https://gemini.google.com/* // @grant none // @license GPL-3.0-or-later // ==/UserScript== (function() { 'use strict'; // 通知を表示する関数 function showNotification(message, success = true) { const notification = document.createElement('div'); notification.style.position = 'fixed'; notification.style.bottom = '20px'; notification.style.right = '20px'; notification.style.padding = '10px 20px'; notification.style.backgroundColor = success ? 'green' : 'red'; notification.style.color = 'white'; notification.style.fontSize = '14px'; notification.style.borderRadius = '5px'; notification.style.zIndex = '1000'; notification.textContent = message; document.body.appendChild(notification); setTimeout(() => { notification.remove(); }, 5000); // 5秒後に自動で消える } // ポップアップ内の「チャットを新規作成」ボタンを探しクリックする関数 function clickConfirmButton() { try { const confirmButton = document.querySelector('button[data-test-id="confirm-button"]'); if (confirmButton) { confirmButton.click(); showNotification('自動クリックに成功しました'); return true; // ボタンがクリックされたらtrueを返す } } catch (error) { console.error('エラーが発生しました:', error); showNotification('自動クリックに失敗しました。詳細はコンソールを確認してください。', false); } return false; // ボタンが見つからないかエラーが発生した場合はfalseを返す } // ページの読み込み完了時にボタンの存在をチェック window.addEventListener('load', () => { clickConfirmButton(); }); // 一定間隔でボタンをチェック setInterval(() => { clickConfirmButton(); }, 1000); // 1秒ごとにチェック })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址