scramjet / src /client /dom /protocol.ts
soiz1's picture
Upload 150 files
bee6636 verified
raw
history blame contribute delete
470 Bytes
import { rewriteUrl } from "../../shared/rewriters/url";
import { ScramjetClient } from "../client";
export default function (client: ScramjetClient, self: Self) {
client.Proxy("Navigator.prototype.registerProtocolHandler", {
apply(ctx) {
ctx.args[1] = rewriteUrl(ctx.args[1], client.meta);
},
});
client.Proxy("Navigator.prototype.unregisterProtocolHandler", {
apply(ctx) {
ctx.args[1] = rewriteUrl(ctx.args[1], client.meta);
},
});
}