I'm a rookie when it comes to JS, and I've been able to work with stuff that already exists, but when it comes to starting from scratch I'm a bit lost.
What I'm trying to accomplish is this..
I'm writing a script\plugin to be used with tampermonkey (chrome plugin).
The script will run in the back ground when I'm on lets say website abcd.com
When I go into that site I click on a link. for example
http://www.abcd.com/blahA/BlahB/&tp=s
I want my script to take the link that I click on, parse it and update it instantly so instead of directing me to the above link it takes me to
http://www.abcd.com/blahA/BlahB/&tp=u
Notice the bold letter that's what I'm changing in the url and redirecting myself to.
Now in the example above it's the last character in the URL, however, in my situation that's not the case, it'll be somewhere in the middle of the URL, but basically what I need to do is a replacement of some sort that searches for "tp=s" and replaces it with "tp=u" only within the abcd.com domain.
How could I go about doing this? Thanks in advance.