mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
indexeddb
This commit is contained in:
parent
430c7ad6ec
commit
6bac2dde2f
1 changed files with 16 additions and 0 deletions
16
src/client/shared/indexeddb.ts
Normal file
16
src/client/shared/indexeddb.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { ScramjetClient } from "../client";
|
||||
|
||||
export default function (client: ScramjetClient, self: Self) {
|
||||
client.Proxy("IDBFactory.prototype.open", {
|
||||
apply(ctx) {
|
||||
ctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;
|
||||
},
|
||||
});
|
||||
|
||||
client.Trap("IDBDatabase.prototype.name", {
|
||||
get(ctx) {
|
||||
let name = ctx.get() as string;
|
||||
return name.substring(name.indexOf("@") + 1);
|
||||
},
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue