pURLfy for Tampermonkey

The ultimate URL purifier - for Tampermonkey

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Вам потребуется установить расширение, например Tampermonkey или Violentmonkey, чтобы установить этот скрипт.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

Автор
PRO-2684
Установок в день
1
Всего установок
1 793
Оценки
16 2 0
Версия
0.6.1
Создано
14.04.2024
Обновлено
29.08.2026
Размер
23,9 КБ
Лицензия
GPL-3.0
Работает на
всех сайтах

pURLfy for Tampermonkey

Greasy Fork Support on Afdian

Navigate to GitHub repo for updated info.

The ultimate URL purifier - Tampermonkey version. This script uses pURLfy core as its core, and integrates its URL purifying functionality into a Tampermonkey script.

Installation

Simply navigate to Greasy Fork and click the "Install this script" button.

Configuration

  • 📖 Rules Settings: Enable or disable rules
    • Tracking: Rules for purifying tracking links
    • Outgoing: Rules for purifying outgoing links
    • Shortener: Rules for restoring shortened links
    • Alternative: Redirects you from some websites to their better alternatives
    • Other: Rules for purifying other types of links
    • Remove Text Fragment: Remove Text Fragments from URL
  • 🪝 Hooks Settings: Enable or disable hooks
    • location.href: Check location.href
    • click: Intercept click events
    • mousedown: Intercept mousedown events
    • auxclick: Intercept auxclick events
    • touchstart: Intercept touchstart events
    • window.open: Hook window.open calls
    • pushState: Hook history.pushState calls
    • replaceState: Hook history.replaceState calls
    • Bing: Site-specific hook for Bing, seems to be unnecessary for now
  • 📊 Statistics: Show statistics
    • URL: Number of links purified
    • Parameter: Number of parameters removed
    • Decoded: Number of URLs decoded (param mode)
    • Redirected: Number of URLs redirected (redirect mode)
    • Visited: Number of URLs visited (visit mode)
    • Character: Number of characters deleted
  • ⚙️ Advanced options: Advanced options
    • Purify URL: Manually purify a URL
    • Senseless Mode: Enable senseless mode
    • Disable Beacon: Overwrite navigator.sendBeacon to a no-op function
      • Try out this feature on Ping Spotter - the "Beacon API" section will show "Request blocked"
    • Debug Mode: Enable debug mode

Senseless Mode

By default, "Senseless Mode" is enabled, and the script will adopt a lenient approach to URL purification, prioritizing user experience over strict URL cleansing. This may help reduce interruptions and maintain website functionality while still providing a level of URL purification.

You can disable it in the advanced options. By doing so, you're switching to "Strict Mode", where this script will take radical measures to ensure that URLs are purified before they are used. However, in some cases, this may lead to noticeable interruptions or even break certain functionalities on some websites.

Here's a table comparing the two modes:

Feature Strict Mode Senseless Mode
URL Purification Priority High Medium
Privacy Protection Level Strict Moderate
Potential Interruptions Possible Less Likely
Target Audience Advanced Users General Users

Technical details:

  • In strict mode, this script will stop mouse events and re-dispatch them after the url is cleaned to ensure the cleaned URL is used. In senseless mode, the script will not stop the event, which may lead to the original URL being used in some cases.
  • In strict mode, this script will immediately change location.href when it detects an uncleaned URL, causing a page reload or even leading to infinite reloads in some cases. In senseless mode, the script will just call history.replaceState to change the URL without reloading the page.

Updating rules

Configuring the update interval for rules

Navigate to Tampermonkey Dashboard - Settings - External, and choose the update interval you want from the dropdown menu.

Updating rules manually

Navigate to Tampermonkey Dashboard - Installed Userscripts - pURLfy for Tampermonkey - External, and for each entry under Resources, click the Update or Delete button. After refreshing the page, the rules will be updated automatically.

How it works

Purifying URLs

See pURLfy core and its source code for more information.

Rules

Rules files can be fount at pURLfy rules.

Hooks

This script hooks certain methods, intercepts calls to them, purifies the URLs, and then calls the original methods with the purified URLs. For more information, see the source code.

Related scripts

去除链接重定向