@lvce-editor/embeds-worker 2.3.0 → 2.4.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.
@@ -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,12 @@ 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
+ };
1011
1006
  const cancelNavigation = id => {
1012
1007
  return invoke('ElectronWebContentsView.cancelNavigation', id);
1013
1008
  };
@@ -1048,6 +1043,8 @@ const commandMap = {
1048
1043
  'ElectronWebContentsView.handleContextMenu': handleContextMenu,
1049
1044
  'ElectronWebContentsView.handleDidNavigate': handleDidNavigate,
1050
1045
  'ElectronWebContentsView.handleTitleUpdated': handleTitleUpdated,
1046
+ 'ElectronWebContentsView.getDomTree': getDomTree,
1047
+ 'ElectronWebContentsView.insertCss': insertCss,
1051
1048
  'ElectronWebContentsView.handleWillNavigate': handleWillNavigate,
1052
1049
  'ElectronWebContentsView.hide': hide,
1053
1050
  'ElectronWebContentsView.inspectElement': inspectElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/embeds-worker",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "",
5
5
  "main": "dist/embedsWorkerMain.js",
6
6
  "type": "module",