扇贝单词笔记编辑框加高, 取词自动朗读

扇贝单词笔记编辑框加大. 取词放大语音按钮 & 自动朗读英音.

  1. // ==UserScript==
  2. // @name 扇贝单词笔记编辑框加高, 取词自动朗读
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.31
  5. // @description 扇贝单词笔记编辑框加大. 取词放大语音按钮 & 自动朗读英音.
  6. // @author wowo878787
  7. // @require https://code.jquery.com/jquery-1.11.0.min.js
  8. // @match https://www.shanbay.com/review/learning/*
  9. // @match https://web.shanbay.com/wordsweb/*
  10. // @match https://www.shanbay.com/
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Your code here...
  18.  
  19. $.noConflict();
  20.  
  21. (function($) {
  22. $(function() {
  23. $("<style></style>")
  24. .text(
  25. "\
  26. textarea.note-textarea{height: 350px;}\
  27. \
  28. .resultModal .resultContent .resultContent-pronunciation .pronunciationItem .pronunciationItem-icon{width: 33px;height: 33px;}\
  29. \
  30. .index_transBox__2yUO4 .index_audio__305yO .index_trumpet__2KSpA{width: 33px;}\
  31. .index_transBox__2yUO4 .index_audio__305yO{height: 35px;}\
  32. "
  33. )
  34. .appendTo($("head"));
  35.  
  36. var will_read = false;
  37. var input_new, input_old;
  38.  
  39. var interval = setInterval(function() {
  40. var is_pop_in_head = $(".resultModal").length; // 页头
  41. var is_pop_in_detail = $(".index_transBox__2yUO4").length; // 详情取词
  42.  
  43. if (is_pop_in_head === 1) {
  44. input_new = $(".resultContent .head-word").text();
  45. } else if (is_pop_in_detail === 1) {
  46. input_new = $(".index_vocab__3Dqmq span:first").text();
  47. }
  48.  
  49. if (input_old != input_new) {
  50. will_read = true;
  51. input_old = input_new;
  52. } else {
  53. will_read = false;
  54. }
  55.  
  56. if (will_read) {
  57. if (is_pop_in_head === 1) {
  58. $(".resultContent-pronunciation")
  59. .find(".pronunciationItem")
  60. .eq(1)
  61. .children("i")
  62. .click();
  63. } else if (is_pop_in_detail === 1) {
  64. $(".index_transBox__2yUO4")
  65. .find(".index_audio__305yO")
  66. .eq(1)
  67. .children(".index_trumpet__2KSpA")
  68. .click();
  69. }
  70. }
  71. }, 900);
  72. });
  73. })(jQuery);
  74.  
  75. // Your code end...
  76.  
  77. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址