8000 wip · NativePHP/electron-plugin@fcb06a9 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit fcb06a9

Browse files
committed
wip
1 parent 20a76f3 commit fcb06a9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dist/server/api/window.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ router.post('/always-on-top', (req, res) => {
5050
res.sendStatus(200);
5151
});
5252
router.post('/open', (req, res) => {
53-
let { id, x, y, frame, width, height, minWidth, minHeight, maxWidth, maxHeight, focusable, hasShadow, url, resizable, movable, minimizable, maximizable, closable, title, alwaysOnTop, titleBarStyle, vibrancy, backgroundColor, transparency } = req.body;
53+
let { id, x, y, frame, width, height, minWidth, minHeight, maxWidth, maxHeight, focusable, hasShadow, url, resizable, movable, minimizable, maximizable, closable, title, alwaysOnTop, titleBarStyle, vibrancy, backgroundColor, transparency, showDevTools, } = req.body;
5454
if (state_1.default.windows[id]) {
5555
state_1.default.windows[id].show();
5656
state_1.default.windows[id].focus();
@@ -82,7 +82,7 @@ router.post('/open', (req, res) => {
8282
contextIsolation: false,
8383
nodeIntegration: true,
8484
} }));
85-
if (process.env.NODE_ENV === 'development') {
85+
if ((process.env.NODE_ENV === 'development' || showDevTools === true) && showDevTools !== false) {
8686
window.webContents.openDevTools();
8787
}
8888
require("@electron/remote/main").enable(window.webContents);

src/server/api/window.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ router.post('/open', (req, res) => {
8181
titleBarStyle,
8282
vibrancy,
8383
backgroundColor,
84-
transparency
84+
transparency,
85+
showDevTools,
8586
} = req.body
8687

8788
if (state.windows[id]) {
@@ -137,7 +138,7 @@ router.post('/open', (req, res) => {
137138
}
138139
})
139140

140-
if (process.env.NODE_ENV === 'development') {
141+
if ((process.env.NODE_ENV === 'development' || showDevTools === true) && showDevTools !== false) {
141142
window.webContents.openDevTools();
142143
}
143144

0 commit comments

Comments
 (0)
0