MassDrop Automatic Guest Mode

When opening a Massdrop URL, check to see if "?mode=guest_open" is appended to the URL, and if not, append it. This will allow unregistered users to browse Massdrop.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        MassDrop Automatic Guest Mode
// @namespace   Symmetry
// @match       *://*.massdrop.com/*
// @run-at      document-start
// @description When opening a Massdrop URL, check to see if "?mode=guest_open" is appended to the URL, and if not, append it. This will allow unregistered users to browse Massdrop.
// @version 0.0.1.20160128061648
// ==/UserScript==

/*--- Test that "?mode=guest_open" is at end of URL, excepting any "hashes"
    or searches.
*/
if ( ! /mode=guest_open/.test(window.location.search) ) {

    var newURL  = window.location.protocol + "//"
                + window.location.host
                + window.location.pathname + "?mode=guest_open"
                + window.location.search
                + window.location.hash
                ;
    /*-- replace() puts the good page in the history instead of the
        bad page.
    */
    window.location.replace (newURL);
}