您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Click the button with ID btnChat when the user presses Cmd-Enter or Ctrl-Enter
// ==UserScript== // @name SAP AI Playground | Trigger Button Click on Cmd/Ctrl-Enter // @namespace http://tampermonkey.net/ // @version 1.0 // @description Click the button with ID btnChat when the user presses Cmd-Enter or Ctrl-Enter // @author ChatGPT, tddschn // @match https://ai-playground.cfapps.sap.hana.ondemand.com/index.html // @grant none // ==/UserScript== (function() { 'use strict'; function triggerButtonClick(e) { // Check if the pressed key is Enter and either Cmd or Ctrl is also pressed if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { const button = document.getElementById("btnChat"); if (button) { button.click(); } } } // Add the event listener to the document document.addEventListener('keydown', triggerButtonClick); })();