diegocr / cleanlinks Goto Github PK
View Code? Open in Web Editor NEWConverts obfuscated/nested links to genuine clean links.
Converts obfuscated/nested links to genuine clean links.
This URL
http://search.yahoo.com/search;_ylt=A2KLtU6FiE1To4AAwuGbvZx4?p=%22video-crockonjs-5%22&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-646
yields a bunch of search results.
One of the results is
http://ri.search.yahoo.com/_ylt=A0LEVy64jE1ThDwAbJBXNyoA;_ylu=X3oDMTByMG04Z2o2BHNlYwNzcgRwb3MDMQRjb2xvA2JmMQR2dGlkAw--/RV=2/RE=1397620024/RO=10/RU=http%3a%2f%2fwww.yuiblog.com%2fblog%2f2010%2f04%2f08%2fvideo-crockonjs-5%2f/RK=0/RS=3KZtZmxXcv.LzNepiyjD4s7TB9U-
CleanLinks should resolve that search result to
http://www.yuiblog.com/blog/2010/04/08/video-crockonjs-5/
This means extracting only this part of the original URL
http%3a%2f%2fwww.yuiblog.com%2fblog%2f2010%2f04%2f08%2fvideo-crockonjs-5%2f
Instead CleanLinks also extracts the part that follows the correct extracted string in the original URL
/RK=0/RS=3KZtZmxXcv.LzNepiyjD4s7TB9U-
This yields the incorrect URL
http://www.yuiblog.com/blog/2010/04/08/video-crockonjs-5//RK=0/RS=3KZtZmxXcv.LzNepiyjD4s7TB9U-
As far as I have tested, you can reproduce the problem with any of the other links on the results page. And you can search on Yahoo! for any other term to generate a different results page.
TripAdvisor uses some kind of Javascript to obfuscate their external links, so this may not be feasible within the scope of this extension. Here's an example page:
http://www.tripadvisor.com/Restaurant_Review-g59976-d1553014-Reviews-San_Pedro_Cafe-Hudson_Wisconsin.html
It has a "Website" link at the top beneath the title, with the following HTML:
Website
Obviously a lot of tracking going on there I would want to avoid. That URL is encoded in their own custom format decoded by javascript, but clicking on it eventually redirects to:
Which then redirects to the correct URL http://sanpedrocafe.com/home.asp
I would guess that final link could be cleaned at the very least. It's really quite a nasty site!
Hey there! From gratipay/gratipay.com#1562 it looks like Clean Links breaks the login flow on www.gittip.com. What can we do about this?
Hi,
Thanks a lot for this ext. I tried to make it clean extra url schemes, by completing the regex in the "Remove from links" list, but nothing happen. Could you help me cleaning this urls? (I know well regex in several languages, not so well in js)
Thanks a lot for your time and effort!
Make highlight style configurable.
Hi,
CL breaks Diigo bookmarklet.
CL Breaks youtube login and mega.co.nz links, which are nested
The target attribute on links (if any) should be respected while on Event Delegation mode.
I have placed the CleanLinks button in my toolbar. I click it to disable CleanLinks. But after a few seconds it turns itself on again.
10%-20% of all text on some HTML web pages is surrounded by unwanted bright yellow highlighting when CleanLinks 2.6.0 is enabled. When CleansLinks 2.6.0 is disabled, all unwanted yellow highlighting disappears and all areas surrounding text in the HTML web page look normal again.
FireFox 30.0 with Classic Theme Restorer 2.2 add-on
Links should open in a new tab as(if) they did before being cleaned.
It just make sense to me. Why to change the original behaviour
I don't see a way to define a new link filter. Where are they defined? This would be very useful.
I want to clean links from Google Maps e.g.:
http://maps.google.com/local_url?dq=search_query&q=http://thelinkiwant.com/&ved=0CJMBEOQE&sa=X&ei=rz1QU53NNLDuwAHQ5YHQAw&s=ANYYN7n25sPRbLI0D13IYt4J_aOceURsgg
Oddly, the link already gets cleaned when I copy it from the context menu, but not when clicking on it. That may be a separate issue.
Original link: http://widget.weibo.com/distribution/comments.php?width=0&appkey=3196502474&dpc=1&url=http://sspai.com/25305
Note: This link is in Weibo comment widget, http://sspai.com/25305
is the page currently on.
Mis-cleaned link: http://sspai.com/25305
Mainly language: zh-CN
lastIndex missing when checking op.remove
*.cox.net causes a "The page isn't redirecting properly" error, apparently due redirections being performed through two or more different subdomains whose urls contains nested links.
I run Firefox 28.0 on OSX 10.8.5 with Clean Links 2.4.6.1. I purchased a game license via http://bluebottlegames.com/main/node/5 using the credit card option, fastspring, but didn't receive a copy of the game because the user ID had been stripped from the request to fastspring.
After discussing with the site admin, [email protected], I narrowed down the problem to my browser. Without repeating the purchase process to test my theory, I believe Clean Links stripped the user ID and caused the problem.
Please investigate, as it's inconvenient for Clean Links to strip URL parameters overzealously and am considering uninstalling the addon.
I just translated the description on AMO.
zh-CN
将加密/内嵌链接还原为直接链接。
例如:http://somesite.com/?to=www.example.com ➜ http://www.example.com/
本扩展可以将混淆/内嵌的链接还原成普通的,干净的链接。
例如:
<ul>
<li>http://www.foobar.com/goto=https://www.yoursite.com ➠ https://www.yoursite.com/</li>
<li>http://example.com/aHR0cDovL3d3dy5nb29nbGUuY29t ➠ http://www.google.com</li>
<li>http://www3.dumbsite.com/external/hit/to/www.foobar.com ➠ http://www.foobar.com/</li>
<li>javascript:window.open('http://somesite.com') ➠ http://somesite.com/</li>
</ul>
它也可以移除链接中的统计/追踪标签,除了内置的规则(比如 UTM、AFF、REF 等),您也可以自行添加规则。
本扩展有两种工作模式:
<ol>
<li><b>元素遍历模式:</b>当页面加载完成后会扫描并处理页面上所有链接。在此模式下工具栏按钮会在处理完成后改变样式,将鼠标悬浮在工具栏按钮上可以看到当前页面上经过处理的链接的个数。</li>
<li><b>事件委托模式:</b>监听页面点击事件,在点击链接时才进行处理。本模式拥有更好的性能,但是不支持实时高亮和计数器。</li>
</ol>
在 2.4 版本之前默认使用元素遍历模式,之后则默认使用事件委托模式,在 Firefox for Android 或 Thunderbird 中请不要修改工作模式。
点击工具栏按钮就能禁用本扩展,同时图标将变为灰色。
如果你有任何问题/建议,请至 <a href="http://forums.mozillazine.org/viewtopic.php?f=48&t=2749445">支持网站(英文)</a>,或者到 <a href="https://github.com/CnSimonChan/CleanLinks/issues">Github(可使用中文)</a> 反馈问题。
✔ 以后的计划
<ol>
<li>改为无需重启扩展。 -<b><i>完成</i></b></li>
<li>支持 Android 版本。 -<b><i>完成</i></b></li>
<li>增加“转换文本到链接”功能。</li>
<li>支持处理粘贴到地址栏的链接。</li>
<li>还原短链。-<b><i>完成,使用跳转监视器</i></b></li>
</ol>
本扩展需要大量的工作和用户基础,所以如果您觉得本扩展不错,请给我们评分并分享给您的朋友们。
䷴䷄䷢
zh-TW
將加密/內嵌鏈接還原為直接鏈接。
例如:http://somesite.com/?to=www.example.com ➜ http://www.example.com/
本擴展可以將混淆/內嵌的鏈接還原成普通的,乾淨的鏈接。
例如:
<ul>
<li>http://www.foobar.com/goto=https://www.yoursite.com ➠ https://www.yoursite.com/</li>
<li>http://example.com/aHR0cDovL3d3dy5nb29nbGUuY29t ➠ http://www.google.com</li>
<li>http://www3.dumbsite.com/external/hit/to/www.foobar.com ➠ http://www.foobar.com/</li>
<li>javascript:window.open('http://somesite.com') ➠ http://somesite.com/</li>
</ul>
它也可以移除鏈接中的統計/追踪標籤,除了內置的規則(比如UTM、AFF、REF 等),您也可以自行添加規則。
本擴展有兩種工作模式:
<ol>
<li><b>元素遍歷模式:</b>當頁面加載完成後會掃描並處理頁面上所有鏈接。在此模式下工具欄按鈕會在處理完成後改變樣式,將鼠標懸浮在工具欄按鈕上可以看到當前頁面上經過處理的鏈接的個數。 </li>
<li><b>事件委託模式:</b>監聽頁麵點擊事件,在點擊鏈接時才進行處理。本模式擁有更好的性能,但是不支持實時高亮和計數器。 </li>
</ol>
在2.4 版本之前默認使用元素遍歷模式,之後則默認使用事件委託模式,在Firefox for Android 或Thunderbird 中請不要修改工作模式。
點擊工具欄按鈕就能禁用本擴展,同時圖標將變為灰色。
如果你有任何問題/建議,請至<a href="http://forums.mozillazine.org/viewtopic.php?f=48&t=2749445">支持網站(英文)</a>,或者到<a href="https://github.com/CnSimonChan/CleanLinks/issues">Github(可使用中文)</a> 反饋問題。
✔ 以後的計劃
<ol>
<li>改為無需重啟擴展。 -<b><i>完成</i></b></li>
<li>支持 Android 版本。 -<b><i>完成</i></b></li>
<li>增加“轉換文本到鏈接”功能。 </li>
<li>支持處理粘貼到地址欄的鏈接。 </li>
<li>還原短鏈。 -<b><i>完成,使用跳轉監視器</i></b></li>
</ol>
本擴展需要大量的工作和用戶基礎,所以如果您覺得本擴展不錯,請給我們評分並分享給您的朋友們。
䷴䷄䷢
I thought the thing said it was removing tracking of userdata and yet podtrac wasn't wiped from it, as it is an annoying thing that doesn't let you get straight onto the link.
怎么破!
For example magnet
links will contains tracker URLs so CL will clean them.
We should care about other protocols which are like nested links but not.
So we can handle only HTTP and HTTPS protocols for better compatibility and needn't add skip rules one by one.
"Redirect Watcher" ... Setup a HTTP Observer
Does CleanLinks connect to any webserver?
If so, tell me
Thanks.
No offense, but I need to ask this question because this add-on is useful.
Do you believe that you won't do this(link below) BS, now and forever?
https://superuser.com/questions/630226/how-to-configure-chrome-to-automatically-fix-urls
..."On Amazon sites, this add-on will replace the referral-ID (affiliate ID) to the developer ones."...
The add-on breaks Wayback Machine links. It's an easy fix in the options, but also I would think an easy fix in the code? Anyway, thanks for the add-on - very handy!
all yahoo search results still not cleaned.
tnx.
@CnSimonChan: Hey there, commit 6af571a has four new strings, would you like to translate them?
Adblock Subscription URL
<a href="abp:subscribe?location=https://~~~~~
Steam Run URL
<a href="steam://~~~~~http://~~~~
Both urls are modified by CleanLinks.
Cannot signup for a new yahoo mail account with CleanLinks enabled
After Firefox is restarted, the addons seems to stop working and the button disappears from clipboard!
Using Firefox 25 on Windows 8 64bit.
On Firefox 26.0 (Windows) the icon/button will not stay on the toolbar or the add-on bar. When placed in either place it disappears when the browser is restarted and it can only be found in the button list again (in "Customize Toolbar") by removing and reinstalling the extension. It might be a conflict with another extension, but none of my other buttons exhibit this behavior.
Hello.
Excellent addon! But it misses one simple feature: whitelisting URLs/parts of URLs.
For example in Google Webmasters tools there are links like:
https://www.google.com/webmasters/tools/settings?hl=en&siteUrl=http://github.com/
Domain www.google.com generally should be cleaned, but links like this one should remain normal.
Please create a new filter to whitelist parts of URLs or just a simple regex on URL.
Thanks!
Disqus encodes redirected URLs in a screwy way. I would expect a URL like
http://redirect.disqus.com/url?url=http%3A%2F%2Fwww.rackspace.com%2Fblog%2Finstant-messaging-and-video-calling-coming-soon-with-hosted-lync%2F:QDPsuBISuRKgttdlVRmoHdYcW3Q&imp=132tm8t14dhied&prev_imp&forum_id=2559485&forum=rackspace-blog&thread_id=2696865475&major_version=metadata&thread=2614290815&zone=internal_discovery
Instead I see
http://redirect.disqus.com/url?url=http%3A%2F%2Fwww.rackspace.com%2Fblog%2Finstant-messaging-and-video-calling-coming-soon-with-hosted-lync%2F%3AQDPsuBISuRKgttdlVRmoHdYcW3Q&imp=132tm8t14dhied&prev_imp&forum_id=2559485&forum=rackspace-blog&thread_id=2696865475&major_version=metadata&thread=2614290815&zone=internal_discovery
Search for
lync%2F
to see the difference
CleanLinks sensibly uses normal URL decoding to include the
:QDPsuBISuRKgttdlVRmoHdYcW3Q
as part of the destination URL.
Disqus is less sensible in generating the source URL. Rather than encode only the destination URL, Disqus also encodes the immediately following ':'. Disqus must use a filter outside normal URL decoding to strip out the
:QDPsuBISuRKgttdlVRmoHdYcW3Q
If you want to extract the destination URL correctly from a Disqus URL, you will have to stop extracting before the encoded ':' (%3A).
I have enabled Redirect Watcher, but it isn't cleaning redirected URLs. I also use RequestPolicy, could there be a conflict?
In particular, I started with this link:
http://yipit.com/aff/click/?deal=wrZC5XRq&key=F38tgRdb&subid1=web-browse&subid2=recommended
It redirected a few times and I got to here:
http://www.emjcd.com/sd70kjsrB/jqv/887FA9AD/AGDDBEE/7/EECA799G98AB7A9BAD/DGj88C9lkClF88lAF7GEFB9i9i9EG7Cm?j=byoj%3DRs21glB9%260xr%3Dnzzv%259G%258L%258Lro1otmyuiogr.ius%258Liozoky%258LAD-sottkgvuroy%258Ljkgry%258L778B6AB-96-zu-yvktj-ut-luuj-gtj-jxotq%259Lzksv_yqov_xugjhruiq%259Jzx0k%3Cipu!2txh-m68gqlm%3Cnzzv%3A%2F%2F222.pjuwui4.ius%3AE6%2Firoiq-9FCCADD-776E989C%3C%3CM%3C%3C
This contains an HTML page with a meta redirect to the final URL below, plus an HTML link. RequestPolicy prompts me prior to each redirect and lets me choose whether to follow it or not. Even if I copy the HTML link to the clipboard, Redirect Cleaner ignores it and I can't figure out why. CopyLink Controller is enabled and usually works.
I added cvosrc to be removed, and it looks like everything else should be covered by the default, but unfortunately nothing gets cleaned.
Hi again Diego,
I use some other extensions or greasemonkeu scripts to clear links in google search, yahoo search and linkedin. I'd like to use your addon to avoid all these... Is is supposed to do it?
For linkedin, my greasemonkey script was:
var re = new RegExp("/.articleURL=([^&])", "i");
var re2 = new RegExp("/redirect?url=([^&]*)", "i");
var links = document.getElementsByTagName("a");
for (var i = 0; i <= links.length-1; i++) {
var m = re.exec(links[i].href);
if (m != null) {
links[i].href = decodeURIComponent(m[1]);
} else {
m = re2.exec(links[i].href);
if (m != null) {
links[i].href = decodeURIComponent(m[1]);
}
}
}
Listening for DOMContentLoad and traversing through open tabs when disabling/updating to (un)patch window.open calls is overkill.
http-on-opening-request or just http-on-modify-request might be more suitable and it'll catch everything being loaded. However, it could slow down the browser considering we'll need to get the window associated with the channel every time a resource is being loaded... [Benchmarks time]
remove tags preceding a query string separator causes a broken url when more than a single query parameter is used (ie, the url contains an ampersand)
I.e. /ref=foo?john=doe&x=2 -> /x=2
I just installed the extension from AMO (version 2.5.1), and it works like a charm when following links in the same tab, or when ctrl-clicking a link to open in a new tab. Cleaning links on "copy link location" does not work however, and neither does the extension clean links when I use "open in new tab" from the context menu (is it even supposed to do that?). Restarting firefox does not help.
I'm using Firefox 29 on Ubuntu 13.10, and the addon is in EventDelegation mode.
Orginal link: https://api.sunrise.am/v2/users/authenticate/google/authorize?redirectURI=https%3A%2F%2Fcalendar.sunrise.am%2Fclose
Mis-cleaned link: https://calendar.sunrise.am/close
Language: English
I'm using Pentadactyl and my toolbar is usually hidden (I only see the tab bar and the status bar). Unless I show the toolbar or add CleanLinks to the status bar, it's never activated.
I very rarely need to interact with CleanLinks, so I'd rather not have a permanent icon for it for it to function correctly.
Not work on wikipedia (redirected from google) with escaped unicode pattern, for example: http://www.google.com/url?q=http://zh.wikipedia.org/zh/%25E8%25A5%25BF%25E7%258F%25AD%25E7%2589%2599&sa=U&ei=xFH2UvPnMqKuiAeIzIEg&ved=0CAsQFjAA&sig2=GCQIALz8xjtuTygi-C5kQA&usg=AFQjCNE7--m2_mu6IWJ_HEWVdTxZ-FbxUw
Alipay's login page https://auth.alipay.com/login/index.htm?needTransfer=true&goto=http://financeprod.alipay.com/account/finance/index.htm contains a goto
query, but it works same as continue
query in Google login page.
So it's needed to add auth.alipay.com
to default skip domain.
How do i create a filter to clean this url.
I have replaced the actual site name with example.com. If you do require the original url, I can paste it but it is NSFW.
CleanLinks disables showing mouseover links at bottom of window
With CleanLinks enabled, when hovering over a link on a page, Firefox does not show the link's URL down at the bottom of the window. Disabling CleanLinks AND RESTARTING Firefox restores this function.
How do I keep CleanLinks enabled yet STILL show me the target URL at the bottom of the window?
Eg: http://somesite.com/?to=www.example.com ➜ http://www.example.com/
Both links changes to "http://www.example.com/#" ("#" in it)
I had received a whitelist request said http://www.wps.cn/product/wps2013/?from=www.wps.cn
is being cleaned to www.wps.cn
.
Maybe it should not clean links in a from
query.
My test included a Google link that Clean Links tries to clean. A random google search was run, then the link's location was copied to the clipboard using Copy Link Location. Then, the link was pasted as text into the URL bar.
Expected the clean link to be pasted, but pasted link was still the Google-tracking-obfuscated link.
Tested on Windows 7 x64, Firefox 30.0. I also run Firefox on Mac and Unix; hopefully this can be fixed on all three OSes.
Move link cleaning function to a module and get rid of the window dependency on some places, such as redirect watcher.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.