Skip to content

Commit a4ca73a

Browse files
committed
[chrome] refactor entire scramjet entry point, splitting isolatedframe, and adding support for isolationless deployments
1 parent 328f46a commit a4ca73a

File tree

17 files changed

+1310
-890
lines changed

17 files changed

+1310
-890
lines changed

packages/chrome/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@heyputer/puter.js": "^2.1.2",
1919
"@mercuryworkshop/bare-mux-custom": "workspace:*",
2020
"@mercuryworkshop/epoxy-transport": "workspace:*",
21+
"@mercuryworkshop/rpc": "workspace:*",
2122
"@mercuryworkshop/libcurl-transport": "workspace:*",
2223
"@mercuryworkshop/scramjet": "workspace:*",
2324
"devtools-protocol": "^0.0.1339468",

packages/chrome/public/controller.sw.js

Lines changed: 254 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
importScripts("./controller.sw.js");
2+
3+
addEventListener("fetch", (event) => {
4+
if ($scramjetController.shouldRoute(event)) {
5+
event.respondWith($scramjetController.route(event));
6+
}
7+
});
8+
9+
self.addEventListener("install", () => {
10+
self.skipWaiting();
11+
});
12+
13+
self.addEventListener("activate", (e) => {
14+
e.waitUntil(self.clients.claim());
15+
});
16+
17+
console.log("sw initialized");

packages/chrome/src/Browser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
animateDownloadFly,
1414
showDownloadsPopup,
1515
} from "./components/Omnibar/Omnibar";
16-
import type { RawDownload } from "./IsolatedFrame";
16+
import type { RawDownload } from "./proxy/fetch";
1717
export const pushTab = createDelegate<Tab>();
1818
export const popTab = createDelegate<Tab>();
1919
export const forceScreenshot = createDelegate<Tab>();

packages/chrome/src/History.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createState } from "dreamland/core";
22
import { browser } from "./Browser";
33
import { StatefulClass } from "./StatefulClass";
44
import type { Tab } from "./Tab";
5-
import { sendFrame } from "./IsolatedFrame";
5+
import { sendFrame } from "./proxy/ipc";
66

77
// history api emulation
88
export class HistoryState extends StatefulClass {

0 commit comments

Comments
 (0)