From 54a41f2431c3d60f5845a15447f13413299e41f2 Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Mon, 24 Feb 2025 01:09:00 +0100
Subject: feat: da extension

---
 src/routes/+layout.svelte | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 src/routes/+layout.svelte

(limited to 'src/routes/+layout.svelte')

diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
new file mode 100644
index 0000000..b0e82a6
--- /dev/null
+++ b/src/routes/+layout.svelte
@@ -0,0 +1,20 @@
+<script lang="ts">
+  import { onDestroy, onMount } from 'svelte';
+  import '../app.css';
+  let { children } = $props();
+
+  let mounted = $state(false);
+  onMount(async () => {
+    (globalThis as any).browser = (
+      await import('webextension-polyfill')
+    ).default;
+    mounted = true;
+  });
+  onDestroy(() => (mounted = false));
+</script>
+
+{#if mounted}
+  {@render children()}
+{:else}
+  <p>Waiting on Mount</p>
+{/if}
-- 
cgit v1.2.3

