@metamask/snaps-execution-environments 3.4.3 → 4.0.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/CHANGELOG.md +24 -1
- package/dist/browserify/iframe/bundle.js +5 -5
- package/dist/browserify/iframe/index.html +1132 -389
- package/dist/browserify/node-process/bundle.js +1135 -392
- package/dist/browserify/node-thread/bundle.js +1135 -392
- package/dist/browserify/webview/bundle.js +9 -0
- package/dist/browserify/{offscreen → webview}/index.html +1132 -389
- package/dist/browserify/worker-executor/bundle.js +1137 -394
- package/dist/browserify/worker-pool/bundle.js +5 -5
- package/dist/browserify/worker-pool/index.html +1132 -389
- package/dist/cjs/common/BaseSnapExecutor.js +2 -2
- package/dist/cjs/common/BaseSnapExecutor.js.map +1 -1
- package/dist/cjs/common/commands.js +18 -0
- package/dist/cjs/common/commands.js.map +1 -1
- package/dist/cjs/common/validation.js +27 -0
- package/dist/cjs/common/validation.js.map +1 -1
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/{offscreen/OffscreenSnapExecutor.js → proxy/ProxySnapExecutor.js} +26 -16
- package/dist/cjs/proxy/ProxySnapExecutor.js.map +1 -0
- package/dist/cjs/proxy/index.js +20 -0
- package/dist/cjs/proxy/index.js.map +1 -0
- package/dist/cjs/webview/WebViewExecutorStream.js +121 -0
- package/dist/cjs/webview/WebViewExecutorStream.js.map +1 -0
- package/dist/cjs/webview/index.js +19 -0
- package/dist/cjs/webview/index.js.map +1 -0
- package/dist/esm/common/BaseSnapExecutor.js +1 -1
- package/dist/esm/common/BaseSnapExecutor.js.map +1 -1
- package/dist/esm/common/commands.js +19 -1
- package/dist/esm/common/commands.js.map +1 -1
- package/dist/esm/common/validation.js +29 -0
- package/dist/esm/common/validation.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/{offscreen/OffscreenSnapExecutor.js → proxy/ProxySnapExecutor.js} +25 -20
- package/dist/esm/proxy/ProxySnapExecutor.js.map +1 -0
- package/dist/esm/proxy/index.js +3 -0
- package/dist/esm/proxy/index.js.map +1 -0
- package/dist/esm/webview/WebViewExecutorStream.js +111 -0
- package/dist/esm/webview/WebViewExecutorStream.js.map +1 -0
- package/dist/esm/webview/index.js +15 -0
- package/dist/esm/webview/index.js.map +1 -0
- package/dist/types/common/validation.d.ts +48 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/{offscreen/OffscreenSnapExecutor.d.ts → proxy/ProxySnapExecutor.d.ts} +9 -9
- package/dist/types/proxy/index.d.ts +1 -0
- package/dist/types/webview/WebViewExecutorStream.d.ts +32 -0
- package/package.json +13 -13
- package/dist/browserify/offscreen/bundle.js +0 -9
- package/dist/cjs/offscreen/OffscreenSnapExecutor.js.map +0 -1
- package/dist/cjs/offscreen/index.js +0 -19
- package/dist/cjs/offscreen/index.js.map +0 -1
- package/dist/esm/offscreen/OffscreenSnapExecutor.js.map +0 -1
- package/dist/esm/offscreen/index.js +0 -15
- package/dist/esm/offscreen/index.js.map +0 -1
- /package/dist/types/{offscreen → webview}/index.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/offscreen/OffscreenSnapExecutor.ts"],"sourcesContent":["import type { BasePostMessageStream } from '@metamask/post-message-stream';\nimport { WindowPostMessageStream } from '@metamask/post-message-stream';\nimport { createWindow, logError } from '@metamask/snaps-utils';\nimport type { JsonRpcRequest } from '@metamask/utils';\nimport { assert } from '@metamask/utils';\n\ntype ExecutorJob = {\n id: string;\n window: Window;\n stream: WindowPostMessageStream;\n};\n\n/**\n * A snap executor using the Offscreen Documents API.\n *\n * This is not a traditional snap executor, as it does not execute snaps itself.\n * Instead, it creates an iframe window for each snap execution, and sends the\n * snap execution request to the iframe window. The iframe window is responsible\n * for executing the snap.\n *\n * Extensions can only have a single offscreen document, so this executor is\n * persisted between snap executions. The offscreen snap executor essentially\n * acts as a proxy between the extension and the iframe execution environment.\n *\n * @see https://developer.chrome.com/docs/extensions/reference/offscreen/\n */\nexport class OffscreenSnapExecutor {\n readonly #stream: BasePostMessageStream;\n\n readonly jobs: Record<string, ExecutorJob> = {};\n\n /**\n * Initialize the executor with the given stream. This is a wrapper around the\n * constructor.\n *\n * @param stream - The stream to use for communication.\n * @returns The initialized executor.\n */\n static initialize(stream: BasePostMessageStream) {\n return new OffscreenSnapExecutor(stream);\n }\n\n constructor(stream: BasePostMessageStream) {\n this.#stream = stream;\n this.#stream.on('data', this.#onData.bind(this));\n }\n\n /**\n * Handle an incoming message from the `OffscreenExecutionService`. This\n * assumes that the message contains a `jobId` property, and a JSON-RPC\n * request in the `data` property.\n *\n * @param data - The message data.\n * @param data.data - The JSON-RPC request.\n * @param data.jobId - The job ID.\n * @param data.extra - Extra data.\n * @param data.extra.frameUrl - The URL to load in the iframe.\n */\n #onData(data: {\n data: JsonRpcRequest;\n jobId: string;\n extra: { frameUrl: string };\n }) {\n const {\n jobId,\n extra: { frameUrl },\n data: request,\n } = data;\n\n if (!this.jobs[jobId]) {\n // This ensures that a job is initialized before it is used. To avoid\n // code duplication, we call the `#onData` method again, which will\n // run the rest of the logic after initialization.\n this.#initializeJob(jobId, frameUrl)\n .then(() => {\n this.#onData(data);\n })\n .catch((error) => {\n logError('[Worker] Error initializing job:', error);\n });\n\n return;\n }\n\n // This is a method specific to the `OffscreenSnapExecutor`, as the service\n // itself does not have access to the iframes directly.\n if (request.method === 'terminateJob') {\n this.#terminateJob(jobId);\n return;\n }\n\n this.jobs[jobId].stream.write(request);\n }\n\n /**\n * Create a new iframe and set up a stream to communicate with it.\n *\n * @param jobId - The job ID.\n * @param frameUrl - The URL to load in the iframe.\n */\n async #initializeJob(jobId: string, frameUrl: string): Promise<ExecutorJob> {\n const window = await createWindow(frameUrl, jobId);\n const jobStream = new WindowPostMessageStream({\n name: 'parent',\n target: 'child',\n targetWindow: window,\n targetOrigin: '*',\n });\n\n // Write messages from the iframe to the parent, wrapped with the job ID.\n jobStream.on('data', (data) => {\n this.#stream.write({ data, jobId });\n });\n\n this.jobs[jobId] = { id: jobId, window, stream: jobStream };\n return this.jobs[jobId];\n }\n\n /**\n * Terminate the job with the given ID. This will close the iframe and delete\n * the job from the internal job map.\n *\n * @param jobId - The job ID.\n */\n #terminateJob(jobId: string) {\n assert(this.jobs[jobId], `Job \"${jobId}\" not found.`);\n\n const iframe = document.getElementById(jobId);\n assert(iframe, `Iframe with ID \"${jobId}\" not found.`);\n\n iframe.remove();\n this.jobs[jobId].stream.destroy();\n delete this.jobs[jobId];\n }\n}\n"],"names":["OffscreenSnapExecutor","initialize","stream","constructor","jobs","on","onData","bind","data","jobId","extra","frameUrl","request","initializeJob","then","catch","error","logError","method","terminateJob","write","window","createWindow","jobStream","WindowPostMessageStream","name","target","targetWindow","targetOrigin","id","assert","iframe","document","getElementById","remove","destroy"],"mappings":";;;;+BA0BaA;;;eAAAA;;;mCAzB2B;4BACD;uBAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuBZ,uCAoBT;;;;;;;;;;GAUC,GACD,uCA0CM,8CAkBN;;;;;GAKC,GACD;AAlGK,MAAMA;IAKX;;;;;;GAMC,GACD,OAAOC,WAAWC,MAA6B,EAAE;QAC/C,OAAO,IAAIF,sBAAsBE;IACnC;IAEAC,YAAYD,MAA6B,CAAE;QAgB3C,iCAAA;QAoCA;;;;;GAKC,GACD,iCAAM;QAwBN,iCAAA;QAjGA,gCAAS;;mBAAT,KAAA;;QAEA,uBAASE,QAAoC,CAAC;uCActCF,SAASA;QACf,yBAAA,IAAI,EAAEA,SAAOG,EAAE,CAAC,QAAQ,0BAAA,IAAI,EAAEC,SAAAA,QAAOC,IAAI,CAAC,IAAI;IAChD;AAyFF;AA5EE,SAAA,OAAQC,IAIP;IACC,MAAM,EACJC,KAAK,EACLC,OAAO,EAAEC,QAAQ,EAAE,EACnBH,MAAMI,OAAO,EACd,GAAGJ;IAEJ,IAAI,CAAC,IAAI,CAACJ,IAAI,CAACK,MAAM,EAAE;QACrB,qEAAqE;QACrE,mEAAmE;QACnE,kDAAkD;QAClD,0BAAA,IAAI,EAAEI,gBAAAA,oBAAN,IAAI,EAAgBJ,OAAOE,UACxBG,IAAI,CAAC;YACJ,0BAAA,IAAI,EAAER,SAAAA,aAAN,IAAI,EAASE;QACf,GACCO,KAAK,CAAC,CAACC;YACNC,IAAAA,oBAAQ,EAAC,oCAAoCD;QAC/C;QAEF;IACF;IAEA,2EAA2E;IAC3E,uDAAuD;IACvD,IAAIJ,QAAQM,MAAM,KAAK,gBAAgB;QACrC,0BAAA,IAAI,EAAEC,eAAAA,mBAAN,IAAI,EAAeV;QACnB;IACF;IAEA,IAAI,CAACL,IAAI,CAACK,MAAM,CAACP,MAAM,CAACkB,KAAK,CAACR;AAChC;AAQA,eAAA,cAAqBH,KAAa,EAAEE,QAAgB;IAClD,MAAMU,SAAS,MAAMC,IAAAA,wBAAY,EAACX,UAAUF;IAC5C,MAAMc,YAAY,IAAIC,0CAAuB,CAAC;QAC5CC,MAAM;QACNC,QAAQ;QACRC,cAAcN;QACdO,cAAc;IAChB;IAEA,yEAAyE;IACzEL,UAAUlB,EAAE,CAAC,QAAQ,CAACG;QACpB,yBAAA,IAAI,EAAEN,SAAOkB,KAAK,CAAC;YAAEZ;YAAMC;QAAM;IACnC;IAEA,IAAI,CAACL,IAAI,CAACK,MAAM,GAAG;QAAEoB,IAAIpB;QAAOY;QAAQnB,QAAQqB;IAAU;IAC1D,OAAO,IAAI,CAACnB,IAAI,CAACK,MAAM;AACzB;AAQA,SAAA,aAAcA,KAAa;IACzBqB,IAAAA,aAAM,EAAC,IAAI,CAAC1B,IAAI,CAACK,MAAM,EAAE,CAAC,KAAK,EAAEA,MAAM,YAAY,CAAC;IAEpD,MAAMsB,SAASC,SAASC,cAAc,CAACxB;IACvCqB,IAAAA,aAAM,EAACC,QAAQ,CAAC,gBAAgB,EAAEtB,MAAM,YAAY,CAAC;IAErDsB,OAAOG,MAAM;IACb,IAAI,CAAC9B,IAAI,CAACK,MAAM,CAACP,MAAM,CAACiC,OAAO;IAC/B,OAAO,IAAI,CAAC/B,IAAI,CAACK,MAAM;AACzB"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
const _postmessagestream = require("@metamask/post-message-stream");
|
|
6
|
-
const _lockdownevents = require("../common/lockdown/lockdown-events");
|
|
7
|
-
const _lockdownmore = require("../common/lockdown/lockdown-more");
|
|
8
|
-
const _OffscreenSnapExecutor = require("./OffscreenSnapExecutor");
|
|
9
|
-
// Lockdown is already applied in LavaMoat
|
|
10
|
-
(0, _lockdownmore.executeLockdownMore)();
|
|
11
|
-
(0, _lockdownevents.executeLockdownEvents)();
|
|
12
|
-
// The stream from the offscreen document to the execution service.
|
|
13
|
-
const parentStream = new _postmessagestream.BrowserRuntimePostMessageStream({
|
|
14
|
-
name: 'child',
|
|
15
|
-
target: 'parent'
|
|
16
|
-
});
|
|
17
|
-
_OffscreenSnapExecutor.OffscreenSnapExecutor.initialize(parentStream);
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/offscreen/index.ts"],"sourcesContent":["import { BrowserRuntimePostMessageStream } from '@metamask/post-message-stream';\n\nimport { executeLockdownEvents } from '../common/lockdown/lockdown-events';\nimport { executeLockdownMore } from '../common/lockdown/lockdown-more';\nimport { OffscreenSnapExecutor } from './OffscreenSnapExecutor';\n\n// Lockdown is already applied in LavaMoat\nexecuteLockdownMore();\nexecuteLockdownEvents();\n\n// The stream from the offscreen document to the execution service.\nconst parentStream = new BrowserRuntimePostMessageStream({\n name: 'child',\n target: 'parent',\n});\n\nOffscreenSnapExecutor.initialize(parentStream);\n"],"names":["executeLockdownMore","executeLockdownEvents","parentStream","BrowserRuntimePostMessageStream","name","target","OffscreenSnapExecutor","initialize"],"mappings":";;;;mCAAgD;gCAEV;8BACF;uCACE;AAEtC,0CAA0C;AAC1CA,IAAAA,iCAAmB;AACnBC,IAAAA,qCAAqB;AAErB,mEAAmE;AACnE,MAAMC,eAAe,IAAIC,kDAA+B,CAAC;IACvDC,MAAM;IACNC,QAAQ;AACV;AAEAC,4CAAqB,CAACC,UAAU,CAACL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/offscreen/OffscreenSnapExecutor.ts"],"sourcesContent":["import type { BasePostMessageStream } from '@metamask/post-message-stream';\nimport { WindowPostMessageStream } from '@metamask/post-message-stream';\nimport { createWindow, logError } from '@metamask/snaps-utils';\nimport type { JsonRpcRequest } from '@metamask/utils';\nimport { assert } from '@metamask/utils';\n\ntype ExecutorJob = {\n id: string;\n window: Window;\n stream: WindowPostMessageStream;\n};\n\n/**\n * A snap executor using the Offscreen Documents API.\n *\n * This is not a traditional snap executor, as it does not execute snaps itself.\n * Instead, it creates an iframe window for each snap execution, and sends the\n * snap execution request to the iframe window. The iframe window is responsible\n * for executing the snap.\n *\n * Extensions can only have a single offscreen document, so this executor is\n * persisted between snap executions. The offscreen snap executor essentially\n * acts as a proxy between the extension and the iframe execution environment.\n *\n * @see https://developer.chrome.com/docs/extensions/reference/offscreen/\n */\nexport class OffscreenSnapExecutor {\n readonly #stream: BasePostMessageStream;\n\n readonly jobs: Record<string, ExecutorJob> = {};\n\n /**\n * Initialize the executor with the given stream. This is a wrapper around the\n * constructor.\n *\n * @param stream - The stream to use for communication.\n * @returns The initialized executor.\n */\n static initialize(stream: BasePostMessageStream) {\n return new OffscreenSnapExecutor(stream);\n }\n\n constructor(stream: BasePostMessageStream) {\n this.#stream = stream;\n this.#stream.on('data', this.#onData.bind(this));\n }\n\n /**\n * Handle an incoming message from the `OffscreenExecutionService`. This\n * assumes that the message contains a `jobId` property, and a JSON-RPC\n * request in the `data` property.\n *\n * @param data - The message data.\n * @param data.data - The JSON-RPC request.\n * @param data.jobId - The job ID.\n * @param data.extra - Extra data.\n * @param data.extra.frameUrl - The URL to load in the iframe.\n */\n #onData(data: {\n data: JsonRpcRequest;\n jobId: string;\n extra: { frameUrl: string };\n }) {\n const {\n jobId,\n extra: { frameUrl },\n data: request,\n } = data;\n\n if (!this.jobs[jobId]) {\n // This ensures that a job is initialized before it is used. To avoid\n // code duplication, we call the `#onData` method again, which will\n // run the rest of the logic after initialization.\n this.#initializeJob(jobId, frameUrl)\n .then(() => {\n this.#onData(data);\n })\n .catch((error) => {\n logError('[Worker] Error initializing job:', error);\n });\n\n return;\n }\n\n // This is a method specific to the `OffscreenSnapExecutor`, as the service\n // itself does not have access to the iframes directly.\n if (request.method === 'terminateJob') {\n this.#terminateJob(jobId);\n return;\n }\n\n this.jobs[jobId].stream.write(request);\n }\n\n /**\n * Create a new iframe and set up a stream to communicate with it.\n *\n * @param jobId - The job ID.\n * @param frameUrl - The URL to load in the iframe.\n */\n async #initializeJob(jobId: string, frameUrl: string): Promise<ExecutorJob> {\n const window = await createWindow(frameUrl, jobId);\n const jobStream = new WindowPostMessageStream({\n name: 'parent',\n target: 'child',\n targetWindow: window,\n targetOrigin: '*',\n });\n\n // Write messages from the iframe to the parent, wrapped with the job ID.\n jobStream.on('data', (data) => {\n this.#stream.write({ data, jobId });\n });\n\n this.jobs[jobId] = { id: jobId, window, stream: jobStream };\n return this.jobs[jobId];\n }\n\n /**\n * Terminate the job with the given ID. This will close the iframe and delete\n * the job from the internal job map.\n *\n * @param jobId - The job ID.\n */\n #terminateJob(jobId: string) {\n assert(this.jobs[jobId], `Job \"${jobId}\" not found.`);\n\n const iframe = document.getElementById(jobId);\n assert(iframe, `Iframe with ID \"${jobId}\" not found.`);\n\n iframe.remove();\n this.jobs[jobId].stream.destroy();\n delete this.jobs[jobId];\n }\n}\n"],"names":["WindowPostMessageStream","createWindow","logError","assert","OffscreenSnapExecutor","initialize","stream","constructor","jobs","on","onData","bind","data","jobId","extra","frameUrl","request","initializeJob","then","catch","error","method","terminateJob","write","window","jobStream","name","target","targetWindow","targetOrigin","id","iframe","document","getElementById","remove","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAASA,uBAAuB,QAAQ,gCAAgC;AACxE,SAASC,YAAY,EAAEC,QAAQ,QAAQ,wBAAwB;AAE/D,SAASC,MAAM,QAAQ,kBAAkB;IAuB9B,uCAoBT;;;;;;;;;;GAUC,GACD,uCA0CM,8CAkBN;;;;;GAKC,GACD;AAhHF;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMC;IAKX;;;;;;GAMC,GACD,OAAOC,WAAWC,MAA6B,EAAE;QAC/C,OAAO,IAAIF,sBAAsBE;IACnC;IAEAC,YAAYD,MAA6B,CAAE;QAgB3C,iCAAA;QAoCA;;;;;GAKC,GACD,iCAAM;QAwBN,iCAAA;QAjGA,gCAAS;;mBAAT,KAAA;;QAEA,uBAASE,QAAoC,CAAC;uCActCF,SAASA;QACf,yBAAA,IAAI,EAAEA,SAAOG,EAAE,CAAC,QAAQ,0BAAA,IAAI,EAAEC,SAAAA,QAAOC,IAAI,CAAC,IAAI;IAChD;AAyFF;AA5EE,SAAA,OAAQC,IAIP;IACC,MAAM,EACJC,KAAK,EACLC,OAAO,EAAEC,QAAQ,EAAE,EACnBH,MAAMI,OAAO,EACd,GAAGJ;IAEJ,IAAI,CAAC,IAAI,CAACJ,IAAI,CAACK,MAAM,EAAE;QACrB,qEAAqE;QACrE,mEAAmE;QACnE,kDAAkD;QAClD,0BAAA,IAAI,EAAEI,gBAAAA,oBAAN,IAAI,EAAgBJ,OAAOE,UACxBG,IAAI,CAAC;YACJ,0BAAA,IAAI,EAAER,SAAAA,aAAN,IAAI,EAASE;QACf,GACCO,KAAK,CAAC,CAACC;YACNlB,SAAS,oCAAoCkB;QAC/C;QAEF;IACF;IAEA,2EAA2E;IAC3E,uDAAuD;IACvD,IAAIJ,QAAQK,MAAM,KAAK,gBAAgB;QACrC,0BAAA,IAAI,EAAEC,eAAAA,mBAAN,IAAI,EAAeT;QACnB;IACF;IAEA,IAAI,CAACL,IAAI,CAACK,MAAM,CAACP,MAAM,CAACiB,KAAK,CAACP;AAChC;AAQA,eAAA,cAAqBH,KAAa,EAAEE,QAAgB;IAClD,MAAMS,SAAS,MAAMvB,aAAac,UAAUF;IAC5C,MAAMY,YAAY,IAAIzB,wBAAwB;QAC5C0B,MAAM;QACNC,QAAQ;QACRC,cAAcJ;QACdK,cAAc;IAChB;IAEA,yEAAyE;IACzEJ,UAAUhB,EAAE,CAAC,QAAQ,CAACG;QACpB,yBAAA,IAAI,EAAEN,SAAOiB,KAAK,CAAC;YAAEX;YAAMC;QAAM;IACnC;IAEA,IAAI,CAACL,IAAI,CAACK,MAAM,GAAG;QAAEiB,IAAIjB;QAAOW;QAAQlB,QAAQmB;IAAU;IAC1D,OAAO,IAAI,CAACjB,IAAI,CAACK,MAAM;AACzB;AAQA,SAAA,aAAcA,KAAa;IACzBV,OAAO,IAAI,CAACK,IAAI,CAACK,MAAM,EAAE,CAAC,KAAK,EAAEA,MAAM,YAAY,CAAC;IAEpD,MAAMkB,SAASC,SAASC,cAAc,CAACpB;IACvCV,OAAO4B,QAAQ,CAAC,gBAAgB,EAAElB,MAAM,YAAY,CAAC;IAErDkB,OAAOG,MAAM;IACb,IAAI,CAAC1B,IAAI,CAACK,MAAM,CAACP,MAAM,CAAC6B,OAAO;IAC/B,OAAO,IAAI,CAAC3B,IAAI,CAACK,MAAM;AACzB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BrowserRuntimePostMessageStream } from '@metamask/post-message-stream';
|
|
2
|
-
import { executeLockdownEvents } from '../common/lockdown/lockdown-events';
|
|
3
|
-
import { executeLockdownMore } from '../common/lockdown/lockdown-more';
|
|
4
|
-
import { OffscreenSnapExecutor } from './OffscreenSnapExecutor';
|
|
5
|
-
// Lockdown is already applied in LavaMoat
|
|
6
|
-
executeLockdownMore();
|
|
7
|
-
executeLockdownEvents();
|
|
8
|
-
// The stream from the offscreen document to the execution service.
|
|
9
|
-
const parentStream = new BrowserRuntimePostMessageStream({
|
|
10
|
-
name: 'child',
|
|
11
|
-
target: 'parent'
|
|
12
|
-
});
|
|
13
|
-
OffscreenSnapExecutor.initialize(parentStream);
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/offscreen/index.ts"],"sourcesContent":["import { BrowserRuntimePostMessageStream } from '@metamask/post-message-stream';\n\nimport { executeLockdownEvents } from '../common/lockdown/lockdown-events';\nimport { executeLockdownMore } from '../common/lockdown/lockdown-more';\nimport { OffscreenSnapExecutor } from './OffscreenSnapExecutor';\n\n// Lockdown is already applied in LavaMoat\nexecuteLockdownMore();\nexecuteLockdownEvents();\n\n// The stream from the offscreen document to the execution service.\nconst parentStream = new BrowserRuntimePostMessageStream({\n name: 'child',\n target: 'parent',\n});\n\nOffscreenSnapExecutor.initialize(parentStream);\n"],"names":["BrowserRuntimePostMessageStream","executeLockdownEvents","executeLockdownMore","OffscreenSnapExecutor","parentStream","name","target","initialize"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ,gCAAgC;AAEhF,SAASC,qBAAqB,QAAQ,qCAAqC;AAC3E,SAASC,mBAAmB,QAAQ,mCAAmC;AACvE,SAASC,qBAAqB,QAAQ,0BAA0B;AAEhE,0CAA0C;AAC1CD;AACAD;AAEA,mEAAmE;AACnE,MAAMG,eAAe,IAAIJ,gCAAgC;IACvDK,MAAM;IACNC,QAAQ;AACV;AAEAH,sBAAsBI,UAAU,CAACH"}
|
|
File without changes
|