aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/stories.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/stories.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/stories.tsx b/packages/taler-wallet-webextension/src/stories.tsx
index 1ad91a13b..9c0f69ec4 100644
--- a/packages/taler-wallet-webextension/src/stories.tsx
+++ b/packages/taler-wallet-webextension/src/stories.tsx
@@ -38,6 +38,9 @@ import * as wallet from "./wallet/index.stories.js";
import * as cta from "./cta/index.stories.js";
import * as components from "./components/index.stories.js";
import { strings } from "./i18n/strings.js";
+import { setupPlatform } from "./platform/api.js";
+import chromeAPI from "./platform/chrome.js";
+import firefoxAPI from "./platform/firefox.js";
const url = new URL(window.location.href);
const lang = url.searchParams.get("lang") || "en";
@@ -441,3 +444,15 @@ function setupLiveReload(port: number, onReload: () => void): void {
console.error(error);
};
}
+
+const isFirefox = typeof (window as any)["InstallTrigger"] !== "undefined";
+
+//FIXME: create different entry point for any platform instead of
+//switching in runtime
+if (isFirefox) {
+ console.log("Wallet setup for Firefox API");
+ setupPlatform(firefoxAPI);
+} else {
+ console.log("Wallet setup for Chrome API");
+ setupPlatform(chromeAPI);
+}