@lvce-editor/main-process 6.9.0 → 6.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mainProcessMain.js +20 -4
- package/package.json +2 -2
package/dist/mainProcessMain.js
CHANGED
|
@@ -4248,6 +4248,18 @@ const {
|
|
|
4248
4248
|
argv
|
|
4249
4249
|
} = process;
|
|
4250
4250
|
|
|
4251
|
+
const accessControlAllowOrigin = 'access-control-allow-origin';
|
|
4252
|
+
const getCorsResponseHeaders = (responseHeaders = {}) => {
|
|
4253
|
+
const hasAccessControlAllowOrigin = Object.keys(responseHeaders).some(key => key.toLowerCase() === accessControlAllowOrigin);
|
|
4254
|
+
if (hasAccessControlAllowOrigin) {
|
|
4255
|
+
return responseHeaders;
|
|
4256
|
+
}
|
|
4257
|
+
return {
|
|
4258
|
+
...responseHeaders,
|
|
4259
|
+
'Access-Control-Allow-Origin': ['*']
|
|
4260
|
+
};
|
|
4261
|
+
};
|
|
4262
|
+
|
|
4251
4263
|
const ClipBoardRead = 'clipboard-read';
|
|
4252
4264
|
const ClipBoardSanitizedWrite = 'clipboard-sanitized-write';
|
|
4253
4265
|
const FullScreen = 'fullscreen';
|
|
@@ -4386,10 +4398,7 @@ const isSessionCacheEnabled = isProduction;
|
|
|
4386
4398
|
|
|
4387
4399
|
const onHeadersReceivedCallback = (details, callback) => {
|
|
4388
4400
|
callback({
|
|
4389
|
-
responseHeaders:
|
|
4390
|
-
'Access-Control-Allow-Origin': ['*'],
|
|
4391
|
-
...details.responseHeaders
|
|
4392
|
-
}
|
|
4401
|
+
responseHeaders: getCorsResponseHeaders(details.responseHeaders)
|
|
4393
4402
|
});
|
|
4394
4403
|
};
|
|
4395
4404
|
|
|
@@ -5017,6 +5026,9 @@ const toggleDevtools = browserWindow => {
|
|
|
5017
5026
|
}
|
|
5018
5027
|
browserWindow.webContents.openDevTools(devtoolsOptions);
|
|
5019
5028
|
};
|
|
5029
|
+
const toggleFullScreen = browserWindow => {
|
|
5030
|
+
browserWindow.setFullScreen(!browserWindow.isFullScreen());
|
|
5031
|
+
};
|
|
5020
5032
|
const executeWindowFunction = (browserWindowId, key) => {
|
|
5021
5033
|
const browserWindow = getBrowserWindow(browserWindowId);
|
|
5022
5034
|
if (!browserWindow) {
|
|
@@ -5026,6 +5038,10 @@ const executeWindowFunction = (browserWindowId, key) => {
|
|
|
5026
5038
|
toggleDevtools(browserWindow);
|
|
5027
5039
|
return;
|
|
5028
5040
|
}
|
|
5041
|
+
if (key === 'toggleFullScreen') {
|
|
5042
|
+
toggleFullScreen(browserWindow);
|
|
5043
|
+
return;
|
|
5044
|
+
}
|
|
5029
5045
|
browserWindow[key]();
|
|
5030
5046
|
};
|
|
5031
5047
|
const executeWebContentsFunction = (browserWindowId, key, ...args) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/main-process",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"lvce-editor",
|
|
6
6
|
"electron"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"main": "dist/mainProcessMain.js",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"electron": "43.1.
|
|
17
|
+
"electron": "43.1.1"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=22"
|