How open and move DevTools window?

Hi, everybody!

I had the following code working until the last RPG Maker MV version (ignores Portuguese comments and strings).

Code:
var cons_pos_x = 1150; // Posicao  X
var cons_pos_y = 180; // Posicao  Y
var cons_tam_x = 716; // Tamanho X, 716 é o padrão
var cons_tam_y = 539; // Tamanho Y, 539 é o padrão.
if (Utils.isNwjs() && Utils.isOptionValid('test')) {
    var consoleWindow = require('nw.gui').Window.get().showDevTools();
    this.focus();
    if(cons_pos_x > window.screen.availWidth || cons_pos_x < 0 || cons_pos_y > window.screen.availHeight || cons_pos_y < 0){
        console.log("Posição da janela inválida. X ou Y está fora da tela.");
        cons_pos_x = 0;
        cons_pos_y = 0;
    }
    consoleWindow.moveTo(cons_pos_x, cons_pos_y);
    consoleWindow.resizeTo(cons_tam_x, cons_tam_y);
};

But, after update 1.6, the DevTools window opens but the var consoleWindow still undefined and doesn't moves. From what I understood, a new NW.js version is being used in RMMV 1.6, so my code is outdated. I'm searching for how correctly opens DevTools window (and if possibly, set it to a variable), focus game window and reposition the DevTools window.

Thanks in advance! 😅
PHP:
var debugWin = require('nw.gui').Window.get();
debugWin.moveTo(720,0);
debugWin.showDevTools();
.showDevTools(); no more return obj
and no more resize, now it keep size in windows regedit.
Look for node in local machine regedit
I tried use here, but the move is moving the appWindow and focus working only when DevTools already open. I thought there was a
corresponding code in this new NW.js. Well, isn't worth it take time just to keep this... crutch, I'll survive without this, haha.

Thanks for answer, Jonforum.
the require still works for now but will be removed in the future. Its moved to the "nw" object. showDevTools no longer returns its window object for security reasons but it does take a callback so you can auto focus the window after it loads when it's opened.
Code:
let gameWindow = nw.Window.get();
gameWindow.showDevTools('', () => nw.Window.get().focus());
gameWindow.moveTo(x, y);
devTools cannot be moved with code. It's position is remembered so it opens where you left it though.

Original thread: https://forums.rpgmakerweb.com/threads/how-open-and-move-devtools-window.91865/