mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
fix postmessage stuff a little more
This commit is contained in:
parent
4ae8dafccb
commit
f48ecdb2b9
3 changed files with 86 additions and 82 deletions
|
@ -3,6 +3,8 @@ import { encodeUrl } from "../../shared/rewriters/url";
|
|||
import type { MessageC2W } from "../../worker";
|
||||
import { ScramjetClient } from "../client";
|
||||
|
||||
const workerpostmessage = Worker.prototype.postMessage;
|
||||
|
||||
export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||
client.Proxy("Worker", {
|
||||
construct({ args, call }) {
|
||||
|
@ -36,7 +38,8 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
|
||||
(async () => {
|
||||
const port = await conn.getInnerPort();
|
||||
worker.postMessage(
|
||||
workerpostmessage.call(
|
||||
worker,
|
||||
{
|
||||
$scramjet$type: "baremuxinit",
|
||||
port,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue