Added event Lisener for webrtc
This commit is contained in:
parent
926ae242c6
commit
f1c05de864
2 changed files with 13 additions and 18 deletions
|
|
@ -16,6 +16,16 @@ const SettingsPage = ({ tab }: LocationPageProps) => {
|
|||
})
|
||||
}, [])
|
||||
|
||||
chrome.privacy.network.webRTCIPHandlingPolicy.onChange.addListener(function (
|
||||
details
|
||||
) {
|
||||
if (details.value === 'disable_non_proxied_udp') {
|
||||
setIsWebRtcDisabled(true)
|
||||
} else {
|
||||
setIsWebRtcDisabled(false)
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
|
@ -24,14 +34,11 @@ const SettingsPage = ({ tab }: LocationPageProps) => {
|
|||
>
|
||||
<Box sx={{ fontSize: '20px', mb: '12px' }}>Settings</Box>
|
||||
<SettingsCheckBox
|
||||
title={'Block WebRTC'}
|
||||
onChange={() => {
|
||||
setWebRtcPolicy()
|
||||
setIsWebRtcDisabled(!isWebRtcDisabled)
|
||||
}}
|
||||
title={'Disable WebRTC'}
|
||||
onChange={setWebRtcPolicy}
|
||||
checked={isWebRtcDisabled}
|
||||
/>
|
||||
<SettingsCheckBox title={'Block Address Autofill'} />
|
||||
<SettingsCheckBox title={'Disable Address Autofill'} />
|
||||
<SettingsCheckBox title={'Dark Mode'} />
|
||||
<Label htmlFor="configuration">Language</Label>
|
||||
<Select name="Language" id="Language">
|
||||
|
|
|
|||
|
|
@ -13,18 +13,6 @@ const setWebRtcPolicy = () => {
|
|||
chrome.storage.sync.set({
|
||||
isWebRtcDisabled: !storage.isWebRtcDisabled,
|
||||
})
|
||||
// chrome.privacy.network.webRTCIPHandlingPolicy.get({}, (s) => {
|
||||
// // let path = 'data/icons/'
|
||||
// // let title = 'WebRTC access is allowed'
|
||||
// if (s.value !== value) {
|
||||
// // path += 'red/'
|
||||
// // title =
|
||||
// console.log('WebRTC access cannot be changed. It is controlled by another extension')
|
||||
// } else if (prefs.enabled === false) {
|
||||
// path += 'disabled/'
|
||||
// title = 'WebRTC access is blocked'
|
||||
// }
|
||||
// })
|
||||
}
|
||||
)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue