[SalesForce] Moved Anonymous window above Dev Console Header, Now cannot reach movement handlebars

I was moving the Execute Anonymous window and accidentally placed it above the outer margin of the Dev Console. Now because I am no longer in the act of moving the small window I am unable to click on its title bar and move it back down because the Dev Console's header is blocking me. What should I do ? I am able to resize the anonymous window a number of ways but the only way to actually move it is by using the handlebars that appear in the title section.

enter image description here

Best Answer

All the Developer Console settings are stored in the IDEWorkspace records, including the positioning of any windows. So if you ever get into an irrecoverable issue with the dev console just delete those records with something like workbench or change the User.WorkspaceId to reset it.

Recovering the execute anonymous window position from an active session will require a lighter touch.

My execute anonymous window seems to consistently have the ID window-1183, but that might just be because it was the first window I opened. Anyway, with that we can force it back into viewable space with JavaScript.

document.getElementById('window-1183').style["top"] = "10px";

Taking it a step further, you could look for any x-window that is off the top of the screen.

Array.from(document.getElementsByClassName("x-window")).forEach(
    function(element, index, array) {
        var top =  parseInt(element.style["top"]);
        console.log(top);
        if(top < 0) {
            element.style["top"] = "10px";
        }
    }
);

Note that this doesn't get the corresponding x-css-shadow, but once it can be dragged again it is easy enough to correct.

Related Topic