您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Interception of F1 keypress on Google Sheets and replaces default behavior with nothing.
// ==UserScript== // @name Google Sheets Suppress F1 Key Preventing Help-Popup // @namespace https://gist.github.com/f-steff // @version 1.1 // @description Interception of F1 keypress on Google Sheets and replaces default behavior with nothing. // @author Flemming Steffensen // @license MIT // @match http://docs.google.com/spreadsheets/* // @match https://docs.google.com/spreadsheets/* // @include http://docs.google.com/spreadsheets/* // @include https://docs.google.com/spreadsheets/* // @grant none // @homepageURL https://gist.github.com/f-steff/83be141ea8ce81a526e1b76a8be4a9bc // @run-at document-start // ==/UserScript== document.addEventListener("keydown", function(event) { // For typical shortcuts // Windows & Linux use the Control key == ctrlKey // Mac uses the Command key == metaKey // Other group keys are altKey and shiftKey var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0; var modifier = isMac ? event.metaKey : event.ctrlKey; var debug = false if(debug) { if (!( (event.code === "ControlLeft") || (event.code === "ControlRight") || (event.code === "MetaLeft") || (event.code === "MetaRight") || (event.code === "AltLeft") || (event.code === "AltRight") || (event.code === "ShiftLeft") || (event.code === "ShiftRight") )) { alert("Key pressed Pressed: " + event.code + " (" + event.keyCode + ") on " + (isMac ? "Mac" : "nonMac ") + (modifier ? "with" : " without") + " modifier." ) } } // For some reason this triggers on F1, but not shift-F1, although event.code is F1 for both. if (event.code === "F1") { event.preventDefault(); } });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址