soiz1's picture
Upload 150 files
bee6636 verified
raw
history blame contribute delete
412 Bytes
import { rewriteUrl, unrewriteUrl } from "../../../shared/rewriters/url";
import { ScramjetClient } from "../../client";
export default function (client: ScramjetClient) {
client.Proxy("EventSource", {
construct(ctx) {
ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
},
});
client.Trap("EventSource.prototype.url", {
get(ctx) {
unrewriteUrl(ctx.get() as string);
},
});
}