mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-17 08:57:07 +00:00
8a5424c5a4
Address audit findings across background handlers, openers, plugins, and UI: URL allowlists, XSS reductions, popup lifecycle fixes, plugin dispose/cleanup, cloud sync hardening, global search mathjs sandbox, and settings storage fixes.
32 lines
800 B
Svelte
32 lines
800 B
Svelte
<script lang="ts">
|
|
import React from "react";
|
|
import ReactDOM from "react-dom";
|
|
import { onDestroy } from "svelte";
|
|
|
|
const e = React.createElement;
|
|
let adapterProps = $props();
|
|
let container = $state<HTMLDivElement | null>(null);
|
|
|
|
$effect(() => {
|
|
if (!container) return;
|
|
|
|
const { el, children, class: className, ...rest } = adapterProps;
|
|
try {
|
|
ReactDOM.render(e(el, rest, children), container);
|
|
} catch (err) {
|
|
console.warn(`react-adapter failed to mount.`, { err });
|
|
}
|
|
});
|
|
|
|
onDestroy(() => {
|
|
if (!container) return;
|
|
try {
|
|
ReactDOM.unmountComponentAtNode(container);
|
|
} catch (err) {
|
|
console.warn(`react-adapter failed to unmount.`, { err });
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<div bind:this={container} class={adapterProps.class}></div>
|