Replace Text and Link Target on a page

109 views Asked by At

I want to make a userscript that changes the Gmail link on Google.com to the Inbox one.

<a class="gb_la" href="https://mail.google.com/mail/?tab=wm&amp;authuser=0" data-pid="23" data-ved="0CBEQwi4oAA">Gmail</a>

to:

<a class="gb_la" href="https://inbox.google.com/" data-pid="23" data-ved="0CBEQwi4oAA">Inbox</a>

But I know nothing about Javascript and/or userscripts. Can anyone help me ?

1

There are 1 answers

2
Sheikh Uzair Hussain On

HTML:

<a class="gb_la" href="https://mail.google.com/mail/?tab=wm&amp;authuser=0" data-pid="23" data-ved="0CBEQwi4oAA" id="link">Gmail</a>

JavaScript: link=document.getElementById("link"); link.src="https://inbox.google.com/"; link.innerHTML="Inbox";