OneClick Tools - McGraw-Hill

Copy/Google with a single click on all McGraw-Hill quiz questions of your course.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         OneClick Tools - McGraw-Hill
// @namespace    https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
// @version      4
// @description  Copy/Google with a single click on all McGraw-Hill quiz questions of your course.
// @author       hacker09
// @match        https://ezto.mheducation.com/ext/map/index.html*
// @icon         https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://ezto.mheducation.com&size=64
// @run-at       document-end
// @grant        none
// ==/UserScript==

setInterval(() => {
  (function() {
    'use strict';
    document.querySelector("#question-info-holder")?.remove();
    document.querySelector(".Win32").style.cursor = "pointer"; //Change cursor style to pointer
    document.querySelector(".Win32").addEventListener('mouseup', function(event) { //When the mouse is clicked
      event.preventDefault(); //Prevent the default context menu from being opened
      if (event.button === 0) { //If the user single click anywhere on the question/answer
        navigator.clipboard.writeText(document.querySelector(".Win32").innerText.replaceAll(/\n|\s+|%media:case.jpg%|Required information|Skip to question|View the animation below, then complete the quiz to test your knowledge of the concept./gm, ' ')); //Copy the text and question
      } else if (event.button === 2) { //If the user right click anywhere on the question/answer
        navigator.clipboard.writeText(document.querySelector(".Win32").querySelector(".question, .worksheet__main > p")?.innerText); //Copy the question
        open('https://www.google.com/search?q=' + encodeURIComponent(document.querySelector(".Win32").innerText.replaceAll(/\n|\s+|%media:case.jpg%|Required information|Skip to question|View the animation below, then complete the quiz to test your knowledge of the concept./gm, ' '))); //Google the question and answer
      } //Finishes the else condition
    }); //Finishes the mouseup event listener
  })()
}, 1000);