File size: 462 Bytes
ea32052
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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,
)