@lvce-editor/main-process 6.37.4 → 6.37.6
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 +21 -17
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -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,31 @@ 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
|
|
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 [];
|
|
6500
|
+
}
|
|
6501
|
+
if (has(event.sender, url)) {
|
|
6502
|
+
return [];
|
|
6508
6503
|
}
|
|
6509
6504
|
const favicons = await resolveNetworkFavicon([faviconUrl]);
|
|
6510
|
-
if (favicons.length === 0 || event.sender.getURL() !== url
|
|
6511
|
-
return;
|
|
6505
|
+
if (favicons.length === 0 || event.sender.getURL() !== url) {
|
|
6506
|
+
return [];
|
|
6512
6507
|
}
|
|
6513
|
-
|
|
6508
|
+
return favicons;
|
|
6514
6509
|
};
|
|
6515
|
-
const handler$4 = (event, url, _httpResponseCode, _httpStatusText,
|
|
6516
|
-
|
|
6510
|
+
const handler$4 = async (event, url, _httpResponseCode, _httpStatusText, _webContentsId) => {
|
|
6511
|
+
const favicons = await loadDefaultFavicon(event, url);
|
|
6512
|
+
const messages = favicons.length > 0 ? [['handleDidNavigate', url], ['handlePageFaviconUpdated', favicons]] : [['handleDidNavigate', url]];
|
|
6517
6513
|
return {
|
|
6518
|
-
messages
|
|
6514
|
+
messages,
|
|
6519
6515
|
result: undefined
|
|
6520
6516
|
};
|
|
6521
6517
|
};
|
|
@@ -6881,6 +6877,14 @@ const attach = webContents => {
|
|
|
6881
6877
|
});
|
|
6882
6878
|
};
|
|
6883
6879
|
|
|
6880
|
+
const send = (method, ...params) => {
|
|
6881
|
+
const rpc = get$1(EmbedsProcess);
|
|
6882
|
+
if (!rpc) {
|
|
6883
|
+
return;
|
|
6884
|
+
}
|
|
6885
|
+
return rpc.send(method, ...params);
|
|
6886
|
+
};
|
|
6887
|
+
|
|
6884
6888
|
const webContentsWithEventListeners = new WeakSet();
|
|
6885
6889
|
const attachEventListenersToWebContents = (webContentsId, webContents, browserWindow) => {
|
|
6886
6890
|
if (webContentsWithEventListeners.has(webContents)) {
|