diegocr / CleanLinks

Converts obfuscated/nested links to genuine clean links.
166 stars 45 forks source link

Possibility to open links from history (via double click) #94

Closed Ede123 closed 9 years ago

Ede123 commented 9 years ago

This is particularly useful if a link was cleaned in error and one quickly wants to open the uncleaned link.

There is one difficulty: By default the "http-on-modify-request" observer cleans all opened links, there's no possibility to prevent this (basically that's exactly what we want but obviously it's problematic if we want to open uncleaned links). I addressed this in commit b37666a (which allows links to be skipped from cleaning). I'm not sure if it's the best solution, so if there were better alternatives I'd be open to change the approach.

diegocr commented 9 years ago

I think there could be the case where several requests and being performed in the background and the "skip" flag might is used for the wrong URL. So, how about if you replace that by appending addon.id to the URL, then in getLink you check the URL for the presence of the addon id and if it's found you can then prevent the cleaning.

Ede123 commented 9 years ago

Actually I started with the approach you describe (I used a randomized "magic" string - randomized to prevent it from being exploited) but found it to be problematic, too:

Do you think the problem you described would be a real world issue?

Otherwise I'd still vote for my approach unless we can come up with something more clever.

diegocr commented 9 years ago

Hi Eduard, first of all sorry for the quite late reply.

Well, looks like you did your homework ;) so i'll just merge this, i was also concerned about the possibility of the addTab (and/or related internal logic) being handled on a delayed/async way, in such case the "skip" flag may takes place on the wrong link, however didn't checked/verified if this is a real world issue/scenario, but i guess i'd need to change it for e10s anyway.

Ede123 commented 9 years ago

Thanks, no problem with the delay (better late then never and I know myself that spare time can be limited).

[Off-topic: Do you already have plans for e10s compatibility?]

diegocr commented 9 years ago

Do you already have plans for e10s compatibility?

No plans yet, other than i'll need to get motivated enough and have some time to do it :)