-3
// ==UserScript==
// @name           TamperMonkey Redirect
// @include        http://tagpro-*.koalabeast.com:*
// @include        http://tangent.jukejuice.com:*
// @include        http://maptest*.newcompte.fr:*
// @version                1.0
// ==/UserScript==
window.location = window.location+'/?spectator=true';

That is the code i have so far. But /?spectator=true gets added forever, i want it to be added once.

/?spectator=true

(example: tagpro-123.koalabeast.com:8000/?spectator=true) to the URL ONLY ONCE? Thanks in advance.

Please note that this is not a duplicate, I tried the other link it did not work so please provide me with the full code and an explaination. Thank you very much!

MasterCard
  • 13
  • 1
  • 5

1 Answers1

-1
if (window.location.search != '?spectator=true') {
   window.location = window.location+'/?spectator=true';
}
duellsy
  • 8,497
  • 2
  • 36
  • 60
bytepirate
  • 329
  • 2
  • 6