@lvce-editor/main-process 2.7.0 → 2.9.0

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.
@@ -3802,7 +3802,7 @@ function requireCommon () {
3802
3802
  createDebug.namespaces = namespaces;
3803
3803
  createDebug.names = [];
3804
3804
  createDebug.skips = [];
3805
- const split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
3805
+ const split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean);
3806
3806
  for (const ns of split) {
3807
3807
  if (ns[0] === '-') {
3808
3808
  createDebug.skips.push(ns.slice(1));
@@ -4055,7 +4055,7 @@ function requireBrowser () {
4055
4055
  function load() {
4056
4056
  let r;
4057
4057
  try {
4058
- r = exports.storage.getItem('debug');
4058
+ r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG');
4059
4059
  } catch (error) {
4060
4060
  // Swallow
4061
4061
  // XXX (@Qix-) should we be logging these?
@@ -5544,7 +5544,7 @@ const createPidMap = () => {
5544
5544
  };
5545
5545
 
5546
5546
  const rpcs = Object.create(null);
5547
- const set$5 = (id, rpc) => {
5547
+ const set$7 = (id, rpc) => {
5548
5548
  rpcs[id] = rpc;
5549
5549
  };
5550
5550
  const get = id => {
@@ -5557,7 +5557,7 @@ const createUtilityProcessRpc = async options => {
5557
5557
  ...options
5558
5558
  });
5559
5559
  const rpcId = options.targetRpcId || options.rpcId || options.ipcId;
5560
- set$5(rpcId, rpc);
5560
+ set$7(rpcId, rpc);
5561
5561
  };
5562
5562
 
5563
5563
  const serializeDeskopCapturerSource = source => {
@@ -6739,6 +6739,20 @@ const getDomTree = async view => {
6739
6739
  const slimCode = getSlimCode(result);
6740
6740
  return slimCode;
6741
6741
  };
6742
+ const insertCss = async (view, code) => {
6743
+ const {
6744
+ webContents
6745
+ } = view;
6746
+ const key = await webContents.insertCSS(code);
6747
+ return key;
6748
+ };
6749
+ const executeJavaScript = async (view, code) => {
6750
+ const {
6751
+ webContents
6752
+ } = view;
6753
+ const key = await webContents.executeJavaScript(code);
6754
+ return key;
6755
+ };
6742
6756
  const reload = view => {
6743
6757
  const {
6744
6758
  webContents
@@ -6857,8 +6871,8 @@ const getStats = view => {
6857
6871
  const {
6858
6872
  webContents
6859
6873
  } = view;
6860
- const canGoBack = webContents.canGoBack();
6861
- const canGoForward = webContents.canGoForward();
6874
+ const canGoBack = webContents.navigationHistory.canGoBack();
6875
+ const canGoForward = webContents.navigationHistory.canGoForward();
6862
6876
  const url = webContents.getURL();
6863
6877
  const title = webContents.getTitle();
6864
6878
  return {
@@ -6994,7 +7008,7 @@ const handleElectronMessagePort = async (messagePort, rpcId) => {
6994
7008
  requiresSocket: requiresSocket
6995
7009
  });
6996
7010
  if (rpcId) {
6997
- set$5(rpcId, rpc);
7011
+ set$7(rpcId, rpc);
6998
7012
  }
6999
7013
  };
7000
7014
 
@@ -7212,6 +7226,9 @@ const commandMap = {
7212
7226
  'ElectronWebContentsViewFunctions.cancelNavigation': wrapBrowserViewCommand(cancelNavigation),
7213
7227
  'ElectronWebContentsViewFunctions.copyImageAt': wrapBrowserViewCommand(copyImageAt),
7214
7228
  'ElectronWebContentsViewFunctions.focus': wrapBrowserViewCommand(focus),
7229
+ 'ElectronWebContentsViewFunctions.insertCss': wrapBrowserViewCommand(insertCss),
7230
+ 'ElectronWebContentsViewFunctions.executeJavaScript': wrapBrowserViewCommand(executeJavaScript),
7231
+ 'ElectronWebContentsViewFunctions.insertJavaScript': wrapBrowserViewCommand(executeJavaScript),
7215
7232
  'ElectronWebContentsViewFunctions.forward': wrapBrowserViewCommand(forward),
7216
7233
  'ElectronWebContentsViewFunctions.getStats': wrapBrowserViewCommand(getStats),
7217
7234
  'ElectronWebContentsViewFunctions.hide': hide,
@@ -7818,7 +7835,10 @@ const Commands$4 = {
7818
7835
  setIframeSrc: wrapBrowserViewCommand(setIframeSrc),
7819
7836
  setIframeSrcFallback: wrapBrowserViewCommand(setIframeSrcFallback),
7820
7837
  show: show,
7821
- getDomTree: getDomTree
7838
+ getDomTree: wrapBrowserViewCommand(getDomTree),
7839
+ insertCss: wrapBrowserViewCommand(insertCss),
7840
+ executeJavaScript: wrapBrowserViewCommand(executeJavaScript),
7841
+ insertJavaScript: wrapBrowserViewCommand(executeJavaScript)
7822
7842
  };
7823
7843
 
7824
7844
  const ElectronWebContentsViewFunctions_ipc = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lvce-editor",
@@ -15,7 +15,7 @@
15
15
  "type": "module",
16
16
  "main": "dist/mainProcessMain.js",
17
17
  "dependencies": {
18
- "electron": "36.2.0"
18
+ "electron": "36.2.1"
19
19
  },
20
20
  "engines": {
21
21
  "node": ">=22"