Update dependencies and version

This commit is contained in:
2024-12-15 18:43:06 +01:00
parent db0ccd9b56
commit 67e03eafaa
13 changed files with 2555 additions and 2793 deletions

View File

@ -37,7 +37,7 @@ async function main() {
let url: string | null;
try {
url = await match.match(re);
} catch (e) {
} catch {
return;
}
@ -64,6 +64,8 @@ async function main() {
// clear completed document
document.documentElement.innerHTML = '';
document.body.style.backgroundColor = '#131313';
// video player
const player = document.createElement('video');
player.style.width = '100%';

View File

@ -2,7 +2,8 @@
import { play } from '~/entries/player/player';
import { onMount } from 'svelte';
let errorMessage: string | null = null;
let errorMessage: string | null = $state(null);
let videoElem: HTMLVideoElement;
onMount(async () => {
@ -10,13 +11,13 @@
await play(videoElem);
videoElem.controls = true;
} catch (e) {
errorMessage = e;
errorMessage = e as string;
}
});
</script>
<!-- svelte-ignore a11y-media-has-caption -->
<video id="video" bind:this={videoElem} />
<!-- svelte-ignore a11y_media_has_caption -->
<video id="video" bind:this={videoElem}></video>
{#if errorMessage}
<div id="message-container">
<p>

View File

@ -7,8 +7,9 @@
<body>
<script type="module">
import Player from '~/entries/player/Player.svelte';
import { mount } from 'svelte';
new Player({
mount(Player, {
target: document.body
});
</script>

View File

@ -39,7 +39,7 @@
<Toggle
bind:checked={hostersEnabled}
id="hosters-enabled"
on:change={() => Hosters.setAll(hostersEnabled)}
onChange={() => Hosters.setAll(hostersEnabled)}
/>
</div>
<hr />
@ -52,7 +52,7 @@
bind:checked={hoster.active}
disabled={!hostersEnabled}
id="hoster-{i}"
on:change={async () => {
onChange={async () => {
if (hoster.active) {
await Hosters.enable(hoster);
} else {
@ -73,7 +73,7 @@
<Toggle
bind:checked={ff2mpvEnabled}
id="ff2mpv"
on:change={async () => {
onChange={async () => {
ff2mpvEnabled = !ff2mpvEnabled;
if (await browser.permissions.request({ permissions: ['nativeMessaging'] })) {
await Other.setFf2mpv(ff2mpvEnabled);

View File

@ -8,8 +8,9 @@
<body style="overflow-y: scroll">
<script type="module">
import Popup from '~/entries/popup/Popup.svelte';
import { mount } from 'svelte';
new Popup({
mount(Popup, {
target: document.body
});
</script>

View File

@ -1,5 +0,0 @@
import App from './Popup.svelte';
new App({
target: document.getElementById('app') as Element
});

View File

@ -1,18 +1,21 @@
<!-- https://flowbite.com/docs/forms/toggle/ -->
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import type { Snippet } from 'svelte';
export let checked = false;
export let disabled = false;
export let id: string | null = null;
const dispatch = createEventDispatcher();
type Props = {
checked?: boolean;
disabled?: boolean;
id?: string | null;
onChange?: () => void;
children?: Snippet;
};
let { checked = $bindable(), disabled, id = null, onChange, children }: Props = $props();
</script>
<label class="toggle">
<slot />
<input type="checkbox" {id} bind:checked {disabled} on:change={(e) => dispatch('change', e)} />
<span />
{@render children?.()}
<input type="checkbox" {id} bind:checked {disabled} onchange={onChange} />
<span></span>
</label>
<style lang="scss" global>

View File

@ -32,8 +32,9 @@ export async function unpack(packed: string): Promise<string> {
async function runInPageContext<T>(toExecute: string): Promise<T | null> {
// test that we are running with the allow-scripts permission
try {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
window.sessionStorage;
} catch (ignore) {
} catch {
return null;
}