leetcode英文版讨论区

中文区的讨论很少,点击查看英文区的讨论

  1. // ==UserScript==
  2. // @name leetcode英文版讨论区
  3. // @version 0.0.5
  4. // @description 中文区的讨论很少,点击查看英文区的讨论
  5. // @author 1xin
  6. // @require http://code.jquery.com/jquery-latest.js
  7. // @noframes
  8. // @match *://leetcode-cn.com/problems/*
  9. // @grant GM_addStyle
  10. // @grant GM.getValue
  11. // @grant GM_openInTab
  12. // @grant GM_notification
  13. // @namespace https://gf.qytechs.cn/users/183871
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. var addNextButton={
  19. addButton:function(next_video_url){
  20. var next_btn_html = '';
  21. next_btn_html +='<button id="englishbutton" class="btn__r7r7 tools-btn__YErs">';
  22. next_btn_html +="<h3>";
  23. next_btn_html +='<font color="red">';
  24. next_btn_html +='查看英文区(leetcode.com)的讨论'
  25. next_btn_html +='</font>'
  26. next_btn_html +="</h3>";
  27. next_btn_html +='</button>';
  28. //增加下一个视频按钮
  29. var ul_tag = $("#app");
  30. if (ul_tag) {
  31. ul_tag.append(next_btn_html);
  32. }
  33. $("#englishbutton").click(function(){
  34. GM_openInTab(next_video_url);
  35. });
  36. }
  37.  
  38. };
  39. var leetSite = window.location.href;
  40. var patt1=new RegExp("(?<=https://leetcode-cn.com/problems/)[^/]+");
  41. var text=patt1.exec(leetSite)
  42. var url_en="https://leetcode.com/problems/";
  43. url_en+=text;
  44. url_en+="/discuss/";
  45. //alert(url_en);
  46. addNextButton.addButton(url_en);
  47. // Your code here...
  48. })();

QingJ © 2025

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