forked from sch/schapps
55 lines
1.7 KiB
ReStructuredText
55 lines
1.7 KiB
ReStructuredText
|
.. title: Clean URLs
|
||
|
.. slug: cleanurls
|
||
|
.. date: 2024-09-24 00:00:00 UTC
|
||
|
.. tags: ecma, html, greasemonkey, link, privacy, tracker, url
|
||
|
.. link: cleanurls
|
||
|
.. description: Original URL redirector and fixer
|
||
|
.. type: text
|
||
|
|
||
|
Remove needless parameters from a given URL and correct it to a cleaner one.
|
||
|
|
||
|
About
|
||
|
-----
|
||
|
|
||
|
This script was started as a proof of concept of utilizing the URL API instead of RegEx.
|
||
|
|
||
|
To add a new hash or parameter, simply add it to the respective array.
|
||
|
|
||
|
Enjoy graceful sharing!
|
||
|
|
||
|
Legend and visual examples
|
||
|
--------------------------
|
||
|
|
||
|
```
|
||
|
l) Discovered URL
|
||
|
URL found within a parameter
|
||
|
|
||
|
w) Pure link
|
||
|
URL without parameters (mere pathname)
|
||
|
|
||
|
g) Safe link
|
||
|
URL with whitelisted parameters
|
||
|
|
||
|
y) Semi-safe link
|
||
|
URL purged by blacklist
|
||
|
|
||
|
r) Unsafe link
|
||
|
Original URL (useful in rare cases)
|
||
|
|
||
|
orderBy orderDir src ref version source url Custom Visual Example
|
||
|
Link №1 ✓ ✓ ✓ ✓ ✕ ✕ ✕ ✕ (l)(w)(g)(r)
|
||
|
Link №2 ✓ ✓ ✕ ✕ ✓ ✕ ✕ ✕ None
|
||
|
Link №3 ✓ ✓ ✕ ✓ ✓ ✕ ✕ ✕ (w)(g)(r)
|
||
|
Link №4 ✓ ✓ ✕ ✓ ✓ ✓ ✓ /ref= (l)(l)(w)(g)(y)(r)
|
||
|
Link №5 ✓ ✓ ✓ ✕ ✓ ✕ ✕ 465933 (l)(w)(g)(y)(r)
|
||
|
Link №6 ✓ ✓ ✕ ✕ ✓ ✕ ✓ ✕ (l)(w)(g)(y)
|
||
|
Link №7 ✕ ✕ ✕ ✓ ✕ ✕ ✕ slackware (l)(w)(r)
|
||
|
Link №8 ✕ ✕ ✕ ✕ ✕ ✓ ✕ (l)(w)(y)
|
||
|
```
|
||
|
|
||
|
Resources
|
||
|
---------
|
||
|
|
||
|
* https://greasyfork.org/scripts/465933-cleanurls-clean-url-improved Greasy Fork
|
||
|
* https://openuserjs.org/scripts/sjehuda/Clean_URL_Improved
|