mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-05-09 12:15:14 +02:00
Make nativeMessaging an optional permission
This commit is contained in:
parent
67c492db47
commit
84605ceb30
@ -17,8 +17,6 @@
|
||||
|
||||
let isMobile: boolean;
|
||||
(async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
isMobile = (await browser.runtime.getPlatformInfo()).os === 'android';
|
||||
})();
|
||||
|
||||
@ -75,7 +73,13 @@
|
||||
<Toggle
|
||||
bind:checked={ff2mpvEnabled}
|
||||
id="ff2mpv"
|
||||
on:change={async () => Other.setFf2mpv(ff2mpvEnabled)}
|
||||
on:change={async () => {
|
||||
ff2mpvEnabled = !ff2mpvEnabled;
|
||||
if (await browser.permissions.request({ permissions: ['nativeMessaging'] })) {
|
||||
await Other.setFf2mpv(ff2mpvEnabled);
|
||||
ff2mpvEnabled = !ff2mpvEnabled;
|
||||
}
|
||||
}}
|
||||
></Toggle>
|
||||
<a
|
||||
class="info-questionmark"
|
||||
|
@ -22,7 +22,8 @@ const sharedManifest: Partial<chrome.runtime.ManifestBase> = {
|
||||
96: 'icons/stream-bypass@96px.png',
|
||||
128: 'icons/stream-bypass@128px.png'
|
||||
},
|
||||
permissions: ['storage', 'nativeMessaging']
|
||||
permissions: ['storage'],
|
||||
optional_permissions: ['nativeMessaging']
|
||||
};
|
||||
|
||||
const browserAction = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user