小红书聚焦搜索

自动删除小红书页面上的navbar、推荐流以及其他信息,只留下搜索框

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        小红书聚焦搜索
// @homepage
// @icon
// @version     0.7
// @description 自动删除小红书页面上的navbar、推荐流以及其他信息,只留下搜索框
// @author      geoochi
// @license     MIT
// @grant       none
// @match       https://www.xiaohongshu.com/explore
// @namespace https://greasyfork.org/users/1262095
// ==/UserScript==

function sleep(ms) {
  return new Promise((resolve) => setTimeout(resolve, ms))
}

;(async function () {
  await sleep(300)
  document.getElementById('mfContainer').remove()

  document
    .getElementsByClassName('mask-paper')[0]
    .getElementsByClassName('active router-link-exact-active')[0]
    .remove()
  document
    .getElementsByClassName('mask-paper')[0]
    .getElementsByClassName('right')[0]
    .remove()

  document.getElementsByClassName('side-bar')[0].remove()

  document.getElementsByClassName('bottom-menu')[0].remove()

  document.getElementsByClassName('input-box')[0].style.cssText =
    'position: absolute; top: 30vh;'
})()