您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Navigate UWorld using z,x,m keys
// ==UserScript== // @name Keyboard shortcuts for question navigation // @version 1.2 // @description Navigate UWorld using z,x,m keys // @author akavi // @match https://apps.uworld.com/* // @namespace https://greasyfork.org/users/1303229 // ==/UserScript== (function() { document.addEventListener('keydown', function(event) { if (event.key === 'z') { // Query the specific element based on the provided selector var element = document.querySelector('body > app-root > usmle-test-interface > testinterface-usmle-mainlayout > div > nbme-layout > div > div.nbme-body > nbme-header > div > div:nth-child(2) > a.step2.medium-screen-icon.ng-star-inserted'); // Check if the element exists and is visible if (element && window.getComputedStyle(element).display !== 'none') { // Simulate a click on the element element.click(); } } }); document.addEventListener('keydown', function(event) { if (event.key === 'x') { // Query the specific element based on the provided selector var element = document.querySelector('body > app-root > usmle-test-interface > testinterface-usmle-mainlayout > div > nbme-layout > div > div.nbme-body > nbme-header > div > div:nth-child(2) > a.step3.medium-screen-icon'); // Check if the element exists and is visible if (element && window.getComputedStyle(element).display !== 'none') { // Simulate a click on the element element.click(); } } }); window.addEventListener('keydown', function(e) { // Check if the pressed key is 'm' if (e.key === 'm') { // Check if Shift and Option keys are pressed simultaneously if (e.shiftKey && e.altKey) { // Prevent the default 'm' key behavior e.preventDefault(); // Simulate a new keydown event for Shift+Option+M var simulatedEvent = new KeyboardEvent('keydown', { key: 'M', code: 'KeyM', keyCode: 77, shiftKey: true, altKey: true, }); // Dispatch the simulated event document.dispatchEvent(simulatedEvent); } else{ var element = document.querySelector("body > app-root > usmle-test-interface > testinterface-usmle-mainlayout > div > nbme-layout > div > div.nbme-body > nbme-header > div > div:nth-child(1) > a.step1.d-none.d-md-flex.bookmark-question.ng-star-inserted") // Check if the element exists and is visible if (element && window.getComputedStyle(element).display !== 'none') { // Simulate a click on the element element.click(); } } } }); })();