百度搜索结果 百度百科图标不要播放视频

百度搜索结果 百度百科图标不要播放视频,还改回弹出百度百科页面

  1. // ==UserScript==
  2. // @name 百度搜索结果 百度百科图标不要播放视频
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6
  5. // @description 百度搜索结果 百度百科图标不要播放视频,还改回弹出百度百科页面
  6. // @author 别问我是谁请叫我雷锋
  7. // @license BSD-3-Clause
  8. // @incompatible firefox Firefox浏览器不会显示词条图标,变成了空白区域,应该从这个空白区域的顶部点击进入百科词条页面。
  9. // @match https://www.baidu.com/*
  10. // @match https://baike.baidu.com/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. 'use strict';
  15. if (location.host != "baike.baidu.com") {
  16.  
  17. jQuery.fn.wait = function (func, times, interval) {
  18. var _times = times || -1, //100次
  19. _interval = interval || 20, //20毫秒每次
  20. _self = this,
  21. _selector = this.selector, //选择器
  22. _iIntervalID; //定时器id
  23. if( this.length ){ //如果已经获取到了,就直接执行函数
  24. func && func.call(this);
  25. } else {
  26. _iIntervalID = setInterval(function() {
  27. if(!_times) { //是0就退出
  28. clearInterval(_iIntervalID);
  29. }
  30. _times <= 0 || _times--; //如果是正数就 --
  31.  
  32. _self = $(_selector); //再次选择
  33. if( _self.length ) { //判断是否取到
  34. func && func.call(_self);
  35. clearInterval(_iIntervalID);
  36. }
  37. }, _interval);
  38. }
  39. return this;
  40. }
  41.  
  42. $(".op-bk-polysemy-imgWrap").wait(function () {
  43. let div = $(".op-bk-polysemy-imgWrap").parent().clone();
  44. let url = $(".op-bk-polysemy-imgWrap").attr("data-url");
  45. for (var x in $(".op-bk-polysemy-imgWrap")) {
  46. if ($(".op-bk-polysemy-imgWrap").length != 0 && !isNaN(x)) {
  47. let url = $(".op-bk-polysemy-imgWrap").get(x).dataset.url;
  48. $(".op-bk-polysemy-imgWrap").get(x).parentElement.innerHTML = "<a href='" + url + "' target='_blank' >" + div.prop("outerHTML") + "</a>";
  49. $(".op-bk-polysemy-imgWrap").get(x).style.pointerEvents = "none";
  50. $(".op-bk-polysemy-imgWrap").find(".op-bk-polysemy-samicon").hide();
  51. }
  52. }
  53. }, 1)
  54.  
  55. $("#wrapper_wrapper").bind("DOMSubtreeModified" , function () {
  56. console.log(1);
  57. let div = $(".op-bk-polysemy-imgWrap").parent().clone();
  58. let url = $(".op-bk-polysemy-imgWrap").attr("data-url");
  59. for (var x in $(".op-bk-polysemy-imgWrap")) {
  60. if ($(".op-bk-polysemy-imgWrap").length != 0 && !isNaN(x)) {
  61. let url = $(".op-bk-polysemy-imgWrap").get(x).dataset.url;
  62. $("#wrapper_wrapper").unbind("DOMSubtreeModified");
  63. $(".op-bk-polysemy-imgWrap").get(x).parentElement.innerHTML = "<a href='" + url + "' target='_blank' >" + div.prop("outerHTML") + "</a>";
  64. $(".op-bk-polysemy-imgWrap").get(x).style.pointerEvents = "none";
  65. $(".op-bk-polysemy-imgWrap").find(".op-bk-polysemy-samicon").hide();
  66. }
  67. }
  68. })
  69.  
  70.  
  71.  
  72. } else {
  73. if (location.search.lastIndexOf("secondId") > 0) { location.href = location.href.substring(0, location.href.lastIndexOf('?')) }
  74. }

QingJ © 2025

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