Mturk Hit Not Accepted

Unaccepted hits will have a light red background.

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       Mturk Hit Not Accepted
// @version    3.0
// @description Unaccepted hits will have a light red background.
// @author     Cristo
// @include    *
// @copyright  2012+, You
// @namespace https://greasyfork.org/users/1973
// ==/UserScript==

//Update to make unaccepted hits more obvious without alert

if(window.location != window.parent.location === true){
    if(window.location.toString().indexOf("ASSIGNMENT_ID_NOT_AVAILABLE") != -1){
        var bod = document.getElementsByTagName("body")[0];
        var prediv = document.createElement("div");
        bod.appendChild(prediv);
        prediv.style.pointerEvents = "none";
        prediv.style.position = "fixed";
        prediv.style.zIndex="999";
        prediv.style.top = "0%";
        prediv.style.left = "0%";
        prediv.style.opacity = "0.5";   									
        prediv.style.width = "100%";
        prediv.style.height = "100%";
        prediv.style.backgroundColor = "rgb(245, 198, 198)";
    }
} else if (window.location != window.parent.location === false) {
    if (document.getElementsByName("hitForm")[1].getAttribute("action") == "/mturk/accept") {
        if(document.getElementById("hit-wrapper")){
            var div = document.getElementById("hit-wrapper");
            var prediv = document.createElement("div");
            div.appendChild(prediv);
            prediv.style.pointerEvents = "none";
            prediv.style.position = "absolute";
            prediv.style.zIndex="999";
            prediv.style.top = div.offsetTop;
            prediv.style.left = div.offsetLeft;
            prediv.style.opacity = "0.5";   									
            prediv.style.width = div.offsetWidth;
            prediv.style.height = div.offsetHeight;
            prediv.style.backgroundColor = "rgb(245, 198, 198)";
        }}}