feat: add allow insecure connections toggle in system settings
Block ws:// relay connections and http:// resource loading by default to prevent browser mixed content warnings. When blocked, resources show clickable URL links instead of error placeholders so users can open them manually. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c9bd7ca7d7
commit
3b4a2ba2d3
29 changed files with 156 additions and 24 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import { isInsecureUrl } from '@/lib/url'
|
||||
import storage from '@/services/local-storage.service'
|
||||
import webService from '@/services/web.service'
|
||||
import { TWebMetadata } from '@/types'
|
||||
import { useEffect, useState } from 'react'
|
||||
import webService from '@/services/web.service'
|
||||
|
||||
export function useFetchWebMetadata(url: string) {
|
||||
const [metadata, setMetadata] = useState<TWebMetadata>({})
|
||||
|
|
@ -10,6 +12,8 @@ export function useFetchWebMetadata(url: string) {
|
|||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!storage.getAllowInsecureConnection() && isInsecureUrl(url)) return
|
||||
|
||||
webService.fetchWebMetadata(url).then((metadata) => setMetadata(metadata))
|
||||
}, [url])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue