mirror of
https://github.com/bytedream/stream-bypass.git
synced 2026-08-04 21:10:40 +02:00
show popup when ff2mpv settings are requested
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { showToast } from '../../state';
|
||||
import { InformationCircle } from '@steeze-ui/heroicons';
|
||||
import { Icon } from '@steeze-ui/svelte-icon';
|
||||
import Toggle from '@/entrypoints/popup/components/Toggle.svelte';
|
||||
@@ -9,10 +10,14 @@
|
||||
FF2MPVSettings.getEnabled().then((val) => (enabled = val));
|
||||
|
||||
/* callbacks */
|
||||
function onEnableChange(enabled: boolean) {
|
||||
async function onEnableChange(enabled: boolean) {
|
||||
if (!enabled) return true;
|
||||
|
||||
return browser.permissions.request({ permissions: ['nativeMessaging'] });
|
||||
const id = setTimeout(() => showToast('Accept the permission request to allow communication with mpv'), 100);
|
||||
const confirmed = await browser.permissions.request({ permissions: ['nativeMessaging'] });
|
||||
clearTimeout(id);
|
||||
|
||||
return confirmed;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user