scramjet / src /client /shared /indexeddb.ts
soiz1's picture
Upload 150 files
bee6636 verified
raw
history blame contribute delete
397 Bytes
import { ScramjetClient } from "../client";
export default function (client: ScramjetClient) {
client.Proxy("IDBFactory.prototype.open", {
apply(ctx) {
ctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;
},
});
client.Trap("IDBDatabase.prototype.name", {
get(ctx) {
const name = ctx.get() as string;
return name.substring(name.indexOf("@") + 1);
},
});
}