Spaces:
Runtime error
Runtime error
neon_arch
✨ feat: provide code to handle the change of selected value in the safe search menu (#210)
ea32052
document.addEventListener( | |
'DOMContentLoaded', | |
() => { | |
let url = new URL(window.location) | |
let searchParams = url.searchParams | |
let safeSearchLevel = searchParams.get('safesearch') | |
if ( | |
safeSearchLevel >= 0 && | |
safeSearchLevel <= 2 && | |
safeSearchLevel !== null | |
) { | |
document.querySelector('.search_options select').value = safeSearchLevel | |
} | |
}, | |
false, | |
) | |