维基增强

维基增强搜索和公式复制

目前為 2023-05-13 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 维基增强
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.1
  5. // @description 维基增强搜索和公式复制
  6. // @author dengsong2022@gmail.com
  7. // @license MIT
  8. // @match *://chat.openai.com/*
  9. // @match *://*.wikipedia.org/*
  10. // @match *://baike.baidu.com/*
  11. // @match *://www.zhihu.com/*
  12. // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.min.js
  13. // @icon https://api.iconify.design/logos:xwiki-icon.svg
  14. // @grant none
  15. // ==/UserScript==
  16.  
  17. (function () {
  18. "use strict";
  19. var jq = $.noConflict(true);
  20. window.MathJax = {
  21. tex: {
  22. inlineMath: [
  23. ["$", "$"],
  24. ["\\(", "\\)"],
  25. ],
  26. forceReparse: true,
  27. },
  28. svg: { fontCache: "global" },
  29. };
  30. jq("head").append("<script async src='https://cdn.bootcdn.net/ajax/libs/mathjax/3.2.2/es5/tex-svg.min.js'></script>");
  31. // 百度百科
  32. jq("#searchForm > .input-wrap").css("width", "424px");
  33. jq("#searchForm > #search").after("<button class='baidubaike-wiki' type='button'>维基百科</button>");
  34. jq(".baidubaike-wiki").on({
  35. click: function () {
  36. window.open("https://zh.wikipedia.org/wiki/" + jq("#query").val());
  37. return false;
  38. },
  39. });
  40. // 知乎
  41. jq(".SearchBar-searchButton").before(
  42. '<span class="zhihu-wiki" style="display:grid;place-items:center;cursor:pointer;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="currentColor" d="m14.97 18.95l-2.56-6.03c-1.02 1.99-2.14 4.08-3.1 6.03c-.01.01-.47 0-.47 0C7.37 15.5 5.85 12.1 4.37 8.68C4.03 7.84 2.83 6.5 2 6.5v-.45h5.06v.45c-.6 0-1.62.4-1.36 1.05c.72 1.54 3.24 7.51 3.93 9.03c.47-.94 1.8-3.42 2.37-4.47c-.45-.88-1.87-4.18-2.29-5c-.32-.54-1.13-.61-1.75-.61c0-.15.01-.25 0-.44l4.46.01v.4c-.61.03-1.18.24-.92.82c.6 1.24.95 2.13 1.5 3.28c.17-.34 1.07-2.19 1.5-3.16c.26-.65-.13-.91-1.21-.91c.01-.12.01-.33.01-.43c1.39-.01 3.48-.01 3.85-.02v.42c-.71.03-1.44.41-1.82.99L13.5 11.3c.18.51 1.96 4.46 2.15 4.9l3.85-8.83c-.3-.72-1.16-.87-1.5-.87v-.45l4 .03v.42c-.88 0-1.43.5-1.75 1.25c-.8 1.79-3.25 7.49-4.85 11.2h-.43Z"/></svg></span>'
  43. );
  44. jq(".zhihu-wiki").on({
  45. click: function () {
  46. window.open("https://zh.wikipedia.org/wiki/" + jq(".SearchBar-input .Input").val());
  47. return false;
  48. },
  49. });
  50. // Your code here...
  51. })();

QingJ © 2025

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