diff --git a/src/client/import.ts b/src/client/import.ts new file mode 100644 index 0000000..541ad58 --- /dev/null +++ b/src/client/import.ts @@ -0,0 +1,5 @@ +import { encodeUrl } from "../shared/rewriters/url" + +window.$sImport = function(url) { + return (function() { }.constructor(`return import("${encodeUrl(url)}")`))(); +} diff --git a/src/client/storage.ts b/src/client/storage.ts index 56a5fba..b218440 100644 --- a/src/client/storage.ts +++ b/src/client/storage.ts @@ -42,6 +42,10 @@ function storageProxy(scope: Storage): Storage { case "length": return store.size; default: + if (prop in Object.prototype) { + return Reflect.get(target, prop); + } + return store.get(prop); } },