Greasy Fork 还支持 简体中文。

sspnote javaer

刷题网页调整

  1. // ==UserScript==
  2. // @name sspnote javaer
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024年8月14日22点45分
  5. // @description 刷题网页调整
  6. // @author onionycs
  7. // @license MIT
  8. // @match https://www.sspnote.com/oj/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=sspnote.com
  10. // @grant none
  11. // @require http://code.jquery.com/jquery-3.x-git.min.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. /* globals jQuery, $, waitForKeyElements */
  18. console.log('sspnote javaer start');
  19. var fbutton= $('#semiTabdetail');
  20. $('<button class="open-answer">打开题解</button>').insertBefore(fbutton);
  21.  
  22. $('.open-answer').click(function() {
  23. $('#semiTabanswer')[0].click();
  24. $('.answer-note').find('a')[3].click();
  25. setTimeout(function(){
  26. fbutton[0].click();
  27. },1000);
  28. });
  29. setTimeout(function() {
  30. console.log('延迟1000ms...');
  31. adjust();
  32. }, 1000);
  33.  
  34.  
  35.  
  36. function adjust() {
  37.  
  38. console.log("start");
  39. $('div[role="combobox"]')[0].click();
  40. var id=$('div[role="combobox"]')[0].id+'-option-2';
  41. setTimeout(function() {
  42. // 这里写你希望延迟执行的代码
  43. console.log('执行了延迟300ms的代码');
  44. $('#'+id)[0].click();
  45. }, 500);
  46. document.getElementsByClassName("left-content")[0].style.width = "40%";
  47. document.getElementsByClassName("right-content")[0].style.width = "60%";
  48. console.log("end");
  49. $('img[alt="image"]')[0].style.maxWidth="30%";
  50.  
  51. }
  52.  
  53. })();