As the title states, i would like to write a script to add certain parameter to the existing url in the address bar of a browser.
// ==UserScript==
// @name RDS
// @version 1
// @grant none
// @include *://webdocument.*/file/*
// @exclude *://webdocument.*/file/*&hsequence*
// ==/UserScript==
if (webLink.indexOf("webdocument") > -1) {
document.location.href = document.location.href + "&hsegment=2";
}
But it's not giving me the results i want. It does works but the redirection time is almost 10 seconds. Most of the time the script doesn't work at all. Is there an alternative way to achieve this?
All i want is to add "&hsegment=2" to the end of URL when http://webdocument.com/file/* is entered. So the output url should be like http://webdocument.com/file/*&hsegment=2