@lvce-editor/embeds-worker 2.3.0 → 2.5.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.
- package/dist/embedsWorkerMain.js +13 -12
- package/package.json +1 -1
package/dist/embedsWorkerMain.js
CHANGED
|
@@ -303,22 +303,11 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
|
303
303
|
const wrap$f = global => {
|
|
304
304
|
return new IpcChildWithModuleWorker(global);
|
|
305
305
|
};
|
|
306
|
-
const withResolvers = () => {
|
|
307
|
-
let _resolve;
|
|
308
|
-
const promise = new Promise(resolve => {
|
|
309
|
-
_resolve = resolve;
|
|
310
|
-
});
|
|
311
|
-
return {
|
|
312
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
313
|
-
resolve: _resolve,
|
|
314
|
-
promise
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
306
|
const waitForFirstMessage = async port => {
|
|
318
307
|
const {
|
|
319
308
|
resolve,
|
|
320
309
|
promise
|
|
321
|
-
} = withResolvers();
|
|
310
|
+
} = Promise.withResolvers();
|
|
322
311
|
port.addEventListener('message', resolve, {
|
|
323
312
|
once: true
|
|
324
313
|
});
|
|
@@ -1008,6 +997,15 @@ const forward = id => {
|
|
|
1008
997
|
const backward = id => {
|
|
1009
998
|
return invoke('ElectronWebContentsView.backward', id);
|
|
1010
999
|
};
|
|
1000
|
+
const getDomTree = id => {
|
|
1001
|
+
return invoke('ElectronWebContentsView.getDomTree', id);
|
|
1002
|
+
};
|
|
1003
|
+
const insertCss = (id, css) => {
|
|
1004
|
+
return invoke('ElectronWebContentsView.insertCss', id, css);
|
|
1005
|
+
};
|
|
1006
|
+
const insertJavaScript = (id, code) => {
|
|
1007
|
+
return invoke('ElectronWebContentsView.insertJavaScript', id, code);
|
|
1008
|
+
};
|
|
1011
1009
|
const cancelNavigation = id => {
|
|
1012
1010
|
return invoke('ElectronWebContentsView.cancelNavigation', id);
|
|
1013
1011
|
};
|
|
@@ -1048,6 +1046,9 @@ const commandMap = {
|
|
|
1048
1046
|
'ElectronWebContentsView.handleContextMenu': handleContextMenu,
|
|
1049
1047
|
'ElectronWebContentsView.handleDidNavigate': handleDidNavigate,
|
|
1050
1048
|
'ElectronWebContentsView.handleTitleUpdated': handleTitleUpdated,
|
|
1049
|
+
'ElectronWebContentsView.getDomTree': getDomTree,
|
|
1050
|
+
'ElectronWebContentsView.insertCss': insertCss,
|
|
1051
|
+
'ElectronWebContentsView.insertJavaScript': insertJavaScript,
|
|
1051
1052
|
'ElectronWebContentsView.handleWillNavigate': handleWillNavigate,
|
|
1052
1053
|
'ElectronWebContentsView.hide': hide,
|
|
1053
1054
|
'ElectronWebContentsView.inspectElement': inspectElement,
|