Greasy Fork

Greasy Fork is available in English.

手机百度搜索净化

在手机百度搜索结果页面隐藏广告和推荐内容和禁止搜索结果自动播放和禁止复制粘贴板口令,提升搜索体验。

当前为 2023-12-17 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        手机百度搜索净化
// @version     2.3
// @author      大萌主
// @description  在手机百度搜索结果页面隐藏广告和推荐内容和禁止搜索结果自动播放和禁止复制粘贴板口令,提升搜索体验。
// @match       https://m.baidu.com/*
// @match       https://www.baidu.com/*
// @run-at       document-start
// @grant        none
// @namespace http://greasyfork.icu/users/452911
// ==/UserScript==

(function() {
    'use strict';

    let style = document.createElement('style');
    style.innerHTML = `.ec_wise_ad *,.ad-wrapper,[srcid^='xcx_'],[srcid='guanfanghao'],[srcid='note_lead'],DIV#page-relative.se-page-relative,[data-video-player='true'],[srcid^='app_mobile_simple'],[srcid='lego_tpl'],[srcid='sp_purc_atom'],[srcid='zk_sc_header'],[srcid='med_wz'],[srcid='fw_on_newsite_three'],[srcid='wenda_inquiry'],[srcid='b2b_straight_wise_vertical_na'],DIV.c-container.ec-container,[data-tpl='adv_wenku_fc'],[srcid='med_wz_aitest'],[srcid='med_disease_drug'],[srcid='fw_on_single_site'],[tpl='recommend_list_san'],[srcid='yl_recommend_list'] {display: none !important;}`;
    document.head.appendChild(style);
})();

document.addEventListener('copy', function(e) {
  var copiedText = window.getSelection().toString();
  if (copiedText.startsWith('1.fu:/') || copiedText.startsWith('#baiduhaokan')) {
    e.preventDefault(); // 阻止写入粘贴板
    console.log('禁止复制以 1.fu:/ 或 #baiduhaokan 开头的内容');
  }
});