Skip to content

Instantly share code, notes, and snippets.

@qgustavor
Created March 6, 2025 17:32
Show Gist options
  • Save qgustavor/c2dba88fdec3d2383310b1503d766065 to your computer and use it in GitHub Desktop.
Save qgustavor/c2dba88fdec3d2383310b1503d766065 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Block DuckDuckGo's AI
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Add kbg=-1 and kbe=0 to DuckDuckGo URLs if missing
// @author qgustavor
// @match *://duckduckgo.com/*
// @grant none
// @installUrl https://gist.github.com/qgustavor/c2dba88fdec3d2383310b1503d766065/raw/no-duck-ai.user.js
// @updateUrl https://gist.github.com/qgustavor/c2dba88fdec3d2383310b1503d766065/raw/no-duck-ai.user.js
// ==/UserScript==
const newUrl = new URL(window.location.href)
const params = newUrl.searchParams
let needsReplace = false
if (!params.has('kbg')) {
params.set('kbg', '-1')
needsReplace = true
}
if (!params.has('kbe')) {
params.set('kbe', '0')
needsReplace = true
}
if (needsReplace) {
window.location.replace(newUrl.toString())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment