🐛 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() {
|
export default function Jump() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const jump = params.get('url');
|
const jump = params.get('url');
|
||||||
if (jump) {
|
const allowedUrls = ['opencat://', 'ama://'];
|
||||||
|
if (jump && allowedUrls.some((url) => jump.startsWith(url))) {
|
||||||
window.location.href = jump;
|
window.location.href = jump;
|
||||||
}
|
}
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
Loading…
Reference in New Issue
Block a user