🐛 fix: limit jump links
This commit is contained in:
parent
49c6e5de2f
commit
65820c0ff8
@ -3,11 +3,11 @@ import { useLocation } from 'react-router-dom';
|
||||
|
||||
export default function Jump() {
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
const jump = params.get('url');
|
||||
if (jump) {
|
||||
const allowedUrls = ['opencat://', 'ama://'];
|
||||
if (jump && allowedUrls.some((url) => jump.startsWith(url))) {
|
||||
window.location.href = jump;
|
||||
}
|
||||
}, [location]);
|
||||
|
Loading…
Reference in New Issue
Block a user