slightly change demo.js to allow it to work on older versions

This commit is contained in:
Toshit Chawda 2024-07-26 16:32:24 -07:00
parent 18d8c59ccc
commit cf0b259eef
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D

View file

@ -1,5 +1,6 @@
import epoxy from "./pkg/epoxy-module-bundled.js"; import epoxyModule from "./pkg/epoxy-module-bundled.js";
(async () => {
const params = (new URL(location.href)).searchParams; const params = (new URL(location.href)).searchParams;
const should_feature_test = params.has("feature_test"); const should_feature_test = params.has("feature_test");
const should_multiparallel_test = params.has("multi_parallel_test"); const should_multiparallel_test = params.has("multi_parallel_test");
@ -28,7 +29,10 @@ const plog = (str) => {
console.log(str); console.log(str);
} }
const { EpoxyClient, EpoxyClientOptions, EpoxyHandlers } = await epoxy(); const epoxy = await epoxyModule();
const EpoxyClientOptions = epoxy.EpoxyClientOptions;
const EpoxyClient = epoxy.EpoxyClient;
const EpoxyHandlers = epoxy.EpoxyHandlers;
let epoxy_client_options = new EpoxyClientOptions(); let epoxy_client_options = new EpoxyClientOptions();
epoxy_client_options.user_agent = navigator.userAgent; epoxy_client_options.user_agent = navigator.userAgent;
@ -266,3 +270,4 @@ if (should_feature_test) {
log(await resp.text()); log(await resp.text());
} }
log("done"); log("done");
})();