From 916db57235837e8cb59b5af1af8381cbf4d82247 Mon Sep 17 00:00:00 2001 From: fofolee Date: Tue, 26 Apr 2022 22:00:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=20showDevTools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lib/sandbox.html | 0 plugin/lib/sandbox.js | 13 ------------- plugin/lib/utoolsLite.js | 2 +- plugin/preload.js | 18 ------------------ 4 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 plugin/lib/sandbox.html delete mode 100644 plugin/lib/sandbox.js diff --git a/plugin/lib/sandbox.html b/plugin/lib/sandbox.html deleted file mode 100644 index e69de29..0000000 diff --git a/plugin/lib/sandbox.js b/plugin/lib/sandbox.js deleted file mode 100644 index dcfa3b2..0000000 --- a/plugin/lib/sandbox.js +++ /dev/null @@ -1,13 +0,0 @@ -window._ = require("lodash") -window.utools = require("./utoolsLite")() -window.exit = () => { - process.exit() -} -// 绕过限制 -setTimeout(() => { - Object.assign(window, { - process, - Buffer, - require - }) -}, 100); diff --git a/plugin/lib/utoolsLite.js b/plugin/lib/utoolsLite.js index 32b34f9..982fffd 100644 --- a/plugin/lib/utoolsLite.js +++ b/plugin/lib/utoolsLite.js @@ -1,6 +1,6 @@ const getuToolsLite = () => { var utoolsLite = Object.assign({}, _.cloneDeep(utools)) - // if (utools.isDev()) return utoolsLite + // if (utools.isDev()) return utoolsLite const dbBlackList = ['db', 'dbStorage', 'removeFeature', 'setFeature', 'onDbPull'] const payBlackList = ['fetchUserServerTemporaryToken', 'getUserServerTemporaryToken', 'openPayment', 'fetchUserPayments'] const etcBlackList = ['onPluginEnter', 'onPluginOut', 'createBrowserWindow'] diff --git a/plugin/preload.js b/plugin/preload.js index df5c07d..d0a5a5b 100644 --- a/plugin/preload.js +++ b/plugin/preload.js @@ -176,24 +176,6 @@ window.quickcommand = { process.execPath child_process.exec(uToolsPath, () => {}) }, - - // 显示一个全功能的 devTools - showDevTools: function() { - if (!browserWindow || browserWindow.webContents.isDestroyed()) { - browserWindow = createBrowserWindow('lib/sandbox.html', { - show: false, - title: '快捷命令', - webPreferences: { - preload: 'lib/sandbox.js', - }, - }, () => {}) - } - browserWindow.webContents.openDevTools({ - mode: 'detach' - }) - // browserWindow.webContents.executeJavaScript(``) - return browserWindow - } } // 运行vbs脚本