mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-12-22 04:18:21 -05:00
✨ feat: provide code to handle the change of selected value in the safe search menu (#210)
This commit is contained in:
parent
b35cb868a6
commit
ea3205226c
18
public/static/search_area_options.js
Normal file
18
public/static/search_area_options.js
Normal 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,
|
||||
)
|
Loading…
Reference in New Issue
Block a user