Skip to content

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Dec 16, 2022

This adds a new execution environment that runs snaps using Chrome's offscreen API. It behaves similar to the iframe execution environment, but uses a proxy between the extension and the iframes, which runs in an offscreen document. This makes it compatible with MV3.

Closes #1088.

@Mrtenz Mrtenz force-pushed the mrtenz/offscreen-environment branch from e819593 to 7ab497e Compare January 4, 2023 11:15
@Mrtenz Mrtenz changed the title Add experimental offscreen execution environment BREAKING: Add experimental offscreen execution environment Jan 4, 2023
@Mrtenz Mrtenz force-pushed the mrtenz/offscreen-environment branch from 4408775 to e3c32bb Compare January 6, 2023 12:39
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2023

Codecov Report

Merging #1082 (92eaabd) into main (ae88c92) will increase coverage by 0.55%.
The diff coverage is 95.78%.

@@            Coverage Diff             @@
##             main    #1082      +/-   ##
==========================================
+ Coverage   94.51%   95.06%   +0.55%     
==========================================
  Files         130      129       -1     
  Lines        4299     4279      -20     
  Branches      729      718      -11     
==========================================
+ Hits         4063     4068       +5     
+ Misses        236      211      -25     
Impacted Files Coverage Δ
...ntrollers/src/services/AbstractExecutionService.ts 90.72% <ø> (ø)
...ices/iframe/test/fixJSDOMPostMessageEventSource.ts 90.00% <ø> (ø)
packages/snaps-utils/src/iframe.ts 84.61% <84.61%> (ø)
...nvironments/src/offscreen/OffscreenSnapExecutor.ts 94.73% <94.73%> (ø)
packages/snaps-controllers/src/services/browser.ts 100.00% <100.00%> (ø)
...lers/src/services/iframe/IframeExecutionService.ts 100.00% <100.00%> (+8.33%) ⬆️
packages/snaps-controllers/src/services/index.ts 100.00% <100.00%> (ø)
...rc/services/offscreen/OffscreenExecutionService.ts 100.00% <100.00%> (ø)
...c/services/offscreen/OffscreenPostMessageStream.ts 100.00% <100.00%> (ø)
.../snaps-controllers/src/services/offscreen/index.ts 100.00% <100.00%> (ø)
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

// TODO: Rather than injecting the frame URL here, we should come up with
// a better way to do this. The frame URL is needed to avoid hard coding
// it in the offscreen execution environment.
frameUrl: this.#frameUrl,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create an issue to figure out if we can remove the need for this being passed?

@Mrtenz Mrtenz force-pushed the mrtenz/offscreen-environment branch from 92eaabd to 9a0829a Compare January 9, 2023 13:55
@Mrtenz Mrtenz changed the title BREAKING: Add experimental offscreen execution environment Add experimental offscreen execution environment Jan 9, 2023
@Mrtenz Mrtenz marked this pull request as ready for review January 9, 2023 14:24
@Mrtenz Mrtenz requested a review from a team as a code owner January 9, 2023 14:24
FrederikBolding
FrederikBolding previously approved these changes Jan 9, 2023
@Mrtenz Mrtenz merged commit 8a6fd4b into main Jan 9, 2023
@Mrtenz Mrtenz deleted the mrtenz/offscreen-environment branch January 9, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement offscreen document snap executor

4 participants