0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-24 15:08:22 -05:00

feat: provide code to handle the change of selected value in the safe search menu (#210)

This commit is contained in:
neon_arch 2023-09-22 19:33:15 +03:00
parent b35cb868a6
commit ea3205226c

View File

@ -0,0 +1,18 @@
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,
)