Upland Improver

Enables clicked outside dialogs to close them

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         Upland Improver
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Enables clicked outside dialogs to close them
// @author       nljuggler
// @match        https://play.upland.me/*
// @icon         https://www.google.com/s2/favicons?domain=upland.me
// @grant        none
// @require      https://code.jquery.com/jquery-2.2.4.js
// ==/UserScript==

$(function(){
    // Property dialog
    $(document).on("click", ".sc-cBOTKl.kfrDeA", function() {
        console.log("clicked");
        $(".show .close-section button").click();
    });

    // Messages, Treasures or Rrofile dialog
    $(document).on("click", ".sc-iwsKbI.gHlBcE", function() {
        console.log("clicked messages, treasures or profile");
        if ($(".card .card .with-left-side-btn button")[1] !== undefined){
            $(".card .card .with-left-side-btn button")[1].click();
        }
        else {
            $(".card .card .card .sc-bdVaJa.jvDJOL button")[0].click();
        }
    });

    $(document).on("click", ".sc-dnqmqq.hbnEBx.card,.sc-dnqmqq.hbnEBx.large_modal,.sc-ifAKCX.fnJSSS", function(e) {
        e.stopPropagation();
    });

    $(document).on("click", ".sc-iwsKbI.gHlBcE", function(e) {
        e.preventDefault();
        e.stopPropagation();
        console.log("clicked");
        $(".card .card .card button")[0].click();
    });

    //sc-dnqmqq hbnEBx card
});