Greasy Fork is available in English.

地址精简

去掉 抖音、bilibili、西瓜、腾讯新闻 网址的多余部分,减小长度。

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.

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

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         地址精简
// @namespace    http://domain.com/directory
// @version      0.3.7
// @author       幸福的赢得
// @match        *://*.douyin.com/*
// @exclude      *://so.douyin.com/*
// @match        *://*.iesdouyin.com/*
// @match        *://*.bilibili.com/*
// @exclude      *://m.bilibili.com/search*
// @exclude      *://search.bilibili.com/*
// @match        *://*.ixigua.com/*
// @match        *://*.inews.qq.com/*
// @include      /^https?:\/\/(greasy|sleazy)fork\.org\/[^/]+\/scripts\/\d+-/
// @match        *://*.zhihu.com/*
// @exclude      *://www.zhihu.com/search?*
// @grant        none
// @description 去掉 抖音、bilibili、西瓜、腾讯新闻 网址的多余部分,减小长度。
// ==/UserScript==
 
if (/:\/\/greasyfork/.test (location.href) ) {
    const m =
    /(\/[^/]+\/scripts\/\d+)-[^/]+(\/.*)?/.exec(location.pathname)
    history.replaceState({}, null, `${location.origin}${m[1]}${m[2] ?? ''}${location.search}${location.hash}`)
    return
}
 
 
if (/\?/.test (location.href) ) {
    var plainPath =
    location.href.replace (/\?.*/, "")
    history.pushState({}, '', plainPath);
}