[Chrome/Firefox 扩展] Neat URL - 净化链接无用参数


#1

因为是我push作者从Firefox移植到Chrome的,所以感觉有义务帮他打打广告……

Chrome 商店地址
Firefox 扩展地址

洁癖患者专用扩展。如果经常做文字编辑工作,需要大量粘贴链接,这个扩展会把 URL 中,不相关的参数去掉,起到净化 URL 的作用。比如会把
https://detail.tmall.com/item.htm?id=557759288520&pid=mm_25282911_3455987_122436732&sku_properties=10004:1617715035;5919063:6536025&t=ca_fx_75-23&tag=ca_fx_75-23&cu=true&utm_source=www.linkstars.com&utm_medium=tuiguang&utm_campaign=t_1000089893_156_0_184__0320a96bcff2148f&utm_term=b610b574e10f4b7aafbeddb4bf9be2df
净化成
https://detail.tmall.com/item.htm?id=557759288520
大量排版时显然更美观

对比同类扩展(例如Pure URL),和小书签(例如alay兄的)。这个扩展的特点(不是优点,只是特点,适不适合你,自行判断):

  1. 针对所有URL,不局限于知名电商。假如你想净化某个“小众罕见”网站的URL,小书签很难办到,这个可以帮你
  2. 可以自定义垃圾参数/规则。再强大的作者,不可能时刻更新,不可能囊括所有情况,遇到内置规则没过滤掉的,自己随手加规则。当然如果有误杀,你也可以去掉某规则,anyway,你有很大的控制权
  3. 自动生效,连小书签的手动点一下,都不再需要,更懒,更自动化

引用一下扩展自带的说明:

Neat URL cleans URLs, removing parameters such as Google Analytics’ utm parameters.

Example
Before:
http://www.phoronix.com/scan.php?page=news_item&px=Ioquake3-Auto-Updater&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Phoronix+(Phoronix)

After:
http://www.phoronix.com/scan.php?page=news_item&px=Ioquake3-Auto-Updater

Custom rules can be added using the global format or the domain specific format (parameter@domain). A domain specific parameter would be, for example, utm_campaign@phoronix.com.

Parameter rules
A parameter is something that starts with ?. You can add your own parameter in the options of Neat URL. The ? is ommitted in the options, so a ?ved parameter becomes “ved”. There are a few exceptions to this rule (see below)

Parameters can be global (for every domain):
utm_source

Parameters can contain @ signs (domain-specific):
nb@tweakers.net

Parameters can contain @ signs with a wildcard so every subdomain will match too:
param@*.wired.com

Parameters can contain @ signs with a wildcard at the end of a domain name (matches every domain name which begins with “google” and ends in an unknown suffix:
param@google.*

Parameters can also apply globally (first rule), except for a (wilcard) domain (second rule):

ref
!ref@amazon.co.uk

The excluded domain always takes precedence. Should you include “ref” and “!ref”, “!ref” will apply.

Other valid parameters (exceptions to the ? rule):
#xtor=RSS-8 (remove this parameter - be sure to include its value as well when you are using anchor tags)
#xtor=RSS-8@futura-sciences.com
$/ref@amazon.* (remove everything after /ref on amazon domains - this will only apply when there are no query parameters left after removing the filtered query parameters)
$$/ref@amazon.* (remove everything after /ref on amazon domains - this will always apply, even when there are other query parameters after removing the filtered query parameters - this option is available because the user should be in control but beware that double dollar signs are dangerous, it might break the URL)

Invalid parameters:
param@.google. (too many wildcards)
!ved (this is some random string - not supported, but it might work)
/ref@amazon.*$ (dollar sign should be at the beginning)

History
Neat URL is based on Lean URL. Neat URL contains a few improvements:

  • set your own URL parameters on the options page (to reach feature parity with Pure URL)
  • fixed for recent Firefox versions
  • a nice animation in the toolbar (can be changed or disabled)
  • domain-specific blocked parameters (to reach feature parity with Pure URL)
  • wildcard domain-specific blocked parameters

Bug reports and feature requests
You can open an issue on GitHub. Please include “Neat URL” in the title of the newly created issue: https://github.com/Smile4ever/firefoxaddons/issues/new


#2

解释一下,小书签可以对任何网址使用,做了基础适配,预计可用度 80%+

对于不适配的网站,我倒是有一些办法解决,但是还没想到优雅的实现方式

不过还是先学习一下这个扩展去,喵,感谢推荐


看了一下,实现思路不同。

他是从网址中删除已知的垃圾参数,这个适配性更强,更不容易出问题。

我是保留已知有用参数,再搭配正则替换,更激进,如果成功,网址几乎是最短可用状态,但是不成功的概率要比这个扩展高。所以我也不敢去实现无需点击自动净化,2333

不过两者搭配,取长补短也不错,日常用扩展,扩展净化不彻底再点一下书签(强行绑定推荐


小书签点一下也不亏,会自动复制到剪切板的


#3

显示上 净化前 跟 净化后, 页面在chrome 打开一样


#4

一直都是手动删的我宛如傻子。


#5

作者移植到 Chrome 还不到3天,bug不可避免(我前天反馈了一个bug,作者光速修复了)

若发现bug,去这里反馈:https://github.com/Smile4ever/firefoxaddons/issues/new


#6

啊,这个以前都不知道~