🏠 返回首頁 

Greasy Fork is available in English.

Bing Homepage Quiz

Automatically answers Bing Homepage Quiz


Installer dette script?
  1. // ==UserScript==
  2. // @name Bing Homepage Quiz
  3. // @name:zh-CN 必应首页测试
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.1
  6. // @description Automatically answers Bing Homepage Quiz
  7. // @description:zh-CN 自动回答必应首页的测试题
  8. // @author PRO
  9. // @match https://cn.bing.com/*
  10. // @icon http://bing.com/favicon.ico
  11. // @grant none
  12. // @license gpl-3.0
  13. // ==/UserScript==
  14. (function() {
  15. 'use strict';
  16. function selectAnswer() {
  17. let quiz = document.getElementById("wkCanvas");
  18. if (!quiz) return;
  19. let next = quiz.querySelector("input[id^=nextQuestionbtn]");
  20. if (next && next.checkVisibility()) next.click();
  21. let answers = quiz.querySelectorAll("div[id^=QuestionPane] a.wk_choicesInstLink div.b_hPanel div.wk_choiceMaxWidth");
  22. for (let answer of answers) {
  23. if (answer.querySelector("div.wk_hideCompulsary")) {
  24. answer.click();
  25. break;
  26. }
  27. }
  28. }
  29. window.setTimeout(selectAnswer, Math.random() * 1000 + 1000);
  30. })();