@lvce-editor/main-process 6.37.4 → 6.37.5

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.
@@ -6480,14 +6480,6 @@ const ElectronBrowserViewEventListenerPageFaviconUpdated = {
6480
6480
  resolveNetworkFavicon
6481
6481
  };
6482
6482
 
6483
- const send = (method, ...params) => {
6484
- const rpc = get$1(EmbedsProcess);
6485
- if (!rpc) {
6486
- return;
6487
- }
6488
- return rpc.send(method, ...params);
6489
- };
6490
-
6491
6483
  const key$4 = 'did-navigate';
6492
6484
  const attach$6 = (webContents, listener) => {
6493
6485
  webContents.on(DidNavigate, listener);
@@ -6495,27 +6487,28 @@ const attach$6 = (webContents, listener) => {
6495
6487
  const detach$4 = (webContents, listener) => {
6496
6488
  webContents.off(DidNavigate, listener);
6497
6489
  };
6498
- const loadDefaultFavicon = async (event, url, webContentsId) => {
6490
+ const loadDefaultFavicon = async (event, url) => {
6499
6491
  let faviconUrl;
6500
6492
  try {
6501
6493
  const parsedUrl = new URL(url);
6502
6494
  if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
6503
- return;
6495
+ return [];
6504
6496
  }
6505
6497
  faviconUrl = new URL('/favicon.ico', parsedUrl).href;
6506
6498
  } catch {
6507
- return;
6499
+ return [];
6508
6500
  }
6509
6501
  const favicons = await resolveNetworkFavicon([faviconUrl]);
6510
6502
  if (favicons.length === 0 || event.sender.getURL() !== url || has(event.sender, url)) {
6511
- return;
6503
+ return [];
6512
6504
  }
6513
- send('ElectronWebContents.handlePageFaviconUpdated', webContentsId, favicons);
6505
+ return favicons;
6514
6506
  };
6515
- const handler$4 = (event, url, _httpResponseCode, _httpStatusText, webContentsId) => {
6516
- void loadDefaultFavicon(event, url, webContentsId);
6507
+ const handler$4 = async (event, url, _httpResponseCode, _httpStatusText, _webContentsId) => {
6508
+ const favicons = await loadDefaultFavicon(event, url);
6509
+ const messages = favicons.length > 0 ? [['handleDidNavigate', url], ['handlePageFaviconUpdated', favicons]] : [['handleDidNavigate', url]];
6517
6510
  return {
6518
- messages: [['handleDidNavigate', url]],
6511
+ messages,
6519
6512
  result: undefined
6520
6513
  };
6521
6514
  };
@@ -6881,6 +6874,14 @@ const attach = webContents => {
6881
6874
  });
6882
6875
  };
6883
6876
 
6877
+ const send = (method, ...params) => {
6878
+ const rpc = get$1(EmbedsProcess);
6879
+ if (!rpc) {
6880
+ return;
6881
+ }
6882
+ return rpc.send(method, ...params);
6883
+ };
6884
+
6884
6885
  const webContentsWithEventListeners = new WeakSet();
6885
6886
  const attachEventListenersToWebContents = (webContentsId, webContents, browserWindow) => {
6886
6887
  if (webContentsWithEventListeners.has(webContents)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "6.37.4",
3
+ "version": "6.37.5",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"