anilmuthineni / foxreplace

Automatically exported from code.google.com/p/foxreplace
0 stars 0 forks source link

Replacing links in Gmail #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey, I'm trying to replace gmail links so they skip the redirect and am running 
into problems.

Some of the links end with something like this 
"&sa=D&sntz=1&usg=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" I want to remove that 
entire part from the end of links withing gmail emails but the "xx" variates 
but seems to always be the same length.

I tried replacing "&sa*" with "" (nothing) but it doesn't help or change 
anything. I also tried replacing "&sa=D&sntz=1&usg=" with "" but it doesn't 
work at all when running the replace.

Any help about removing that last part from the links in gmail emails please?

Thanks.

Original issue reported on code.google.com by FatBasta...@gmail.com on 24 Jan 2013 at 10:10

GoogleCodeExporter commented 9 years ago
Hi, first of all let me tell you that automatic substitutions don't work in 
Gmail, so you would have to apply the substitution manually every time (i.e. 
having it in the list and applying the list).

Then, if the problem is that it doens't replace the link even manually, that's 
a different thing. To replace links you have to either check the checkbox to 
replace URLs or either use HTML substitutions. With this, your second example 
should work.

To change the entire string you should use a regular expression, something like 
this: "&sa=D&sntz=1&usg=.{20}" (change the 20 with the actual number of 
characters in the "xxxx" part).

Original comment by marc.r...@gmail.com on 25 Jan 2013 at 12:26

GoogleCodeExporter commented 9 years ago
Thanks for the reply, appreciated.

Thought I'd add I think I remember getting it to work automatically (on load) 
with Gmail, at least for removing the first part of the links for the 
redirects, I was just having trouble removing the last variable part. Perhaps 
it worked due to me not allowing google.com scripts. I can't check right now to 
be 100% certain it works in that situation because I've since found a Firefox 
addon that automatically removes all redirects and don't want to 
uninstall/reinstall test etc.

I ended up going with that addon rather than this due to the way Youtube is 
doing it's redirects (though apparently not all people are getting them), 
youtube displays the correct link until it's clicked/opened in a new tab, then 
changes the link URL on the youtube page to now reflect the redirect, so I 
couldn't get this to help me on youtube, though I might not have tried hard 
enough.

Anyway just thought I'd reply, and found a way to avoided the google/youtube 
redirects which annoy me to no end.

Cheers.

Original comment by FatBasta...@gmail.com on 25 Jan 2013 at 12:58

GoogleCodeExporter commented 9 years ago
If you don't allow google.com scripts then I suppose Gmail was in it's "basic 
HTML version" and this way automatic substitutions should work, as you say. 
They just don't work with AJAX.

Thanks for responding that you have found a solution, so I can close this issue 
now.

Original comment by marc.r...@gmail.com on 25 Jan 2013 at 5:31