<!DOCTYPE html>
<html>
  <head>
    <title>My Awesome Screensaver</title>
    <script>
      // this little javascript snippet will parse any incoming URL
      // parameters and place them in the window.urlParams object
      window.urlParams = window.location.search.split(/[?&]/).slice(1).map(function(paramPair) {
        return paramPair.split(/=(.+)?/).slice(0, 2);
      }).reduce(function (obj, pairArray) {            
        obj[pairArray[0]] = pairArray[1];
        return obj;
      }, {});
    </script>
  </head>
  <body>
    Put the content of your screensaver here!
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <title>My Awesome Screensaver</title>
    <script>
     // load any incoming URL parameters. you could just use the
     // URLSearchParams object directly to manage these variables, but
     // having them in a hash is a little easier sometimes.
     var tmpParams = new URLSearchParams(document.location.search);
     window.urlParams = {};

     for(let k of tmpParams.keys() ) {
       window.urlParams[k] = tmpParams.get(k);
     }
    </script>
  </head>
  <body>
    <h1>Hello! I am a screensaver template!</h1>
    <p>I am located in <code><script>document.write(document.location.pathname);</script></code>.</p>
    <p>Put the content of your screensaver here!</p>
    <h2>Incoming Values</h2>
    <p>(These values will be sent to your screensaver when it loads)</p> 
    <ul>
      <script>
       for(let k of Object.keys(window.urlParams) ) {
         document.write("<li><code>window.urlParams[" + k + "]</code>: " + window.urlParams[k] + "</li>");
       }
      </script>
    </ul>
  </body>
</html>

Clean up the screensaver template
Clean up the screensaver template
