mirror of https://gitlab.com/curben/blog
feat: use duckduckgo onion address if site is .onion
This commit is contained in:
parent
0e2799edbf
commit
a3739cf6de
|
@ -6,3 +6,12 @@ document.getElementById('searchClick').addEventListener('click', () => {
|
||||||
document.getElementById('searchClickMob').addEventListener('click', () => {
|
document.getElementById('searchClickMob').addEventListener('click', () => {
|
||||||
searchFormMob.submit()
|
searchFormMob.submit()
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
|
// Use duckduckgo's onion address when the site is accessed via .onion
|
||||||
|
if (document.location.hostname.endsWith('.onion')) {
|
||||||
|
const searchForms = document.querySelectorAll('form#searchForm, form#searchFormMob')
|
||||||
|
|
||||||
|
searchForms.forEach((form) => {
|
||||||
|
form.setAttribute('action', 'https://3g2upl4pq6kufc4m.onion/')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue