mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 11:26:41 +00:00
feat(userscripts/kagi): update kagi for userscripts
This commit is contained in:
24
userscripts/kagi-for-safari-bing.user.js
Normal file
24
userscripts/kagi-for-safari-bing.user.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name Kagi for Safari (Bing redirect)
|
||||||
|
// @description Redirects Bing searches to Kagi.com. Only relevant for desktop Safari users.
|
||||||
|
// @version 0.0.6
|
||||||
|
// @namespace jimeh.me
|
||||||
|
// @downloadURL https://github.com/jimeh/dotfiles/raw/main/userscripts/kagi-for-safari-bing.user.js
|
||||||
|
// @updateURL https://github.com/jimeh/dotfiles/raw/main/userscripts/kagi-for-safari-bing.user.js
|
||||||
|
// @inject-into auto
|
||||||
|
// @run-at document-start
|
||||||
|
// @match https://www.bing.com/search*
|
||||||
|
// ==/UserScript==
|
||||||
|
(function () {
|
||||||
|
if (
|
||||||
|
navigator.vendor.match(/apple/i) && // Only activate in Safari.
|
||||||
|
window.location.hostname == "www.bing.com" &&
|
||||||
|
window.location.pathname == "/search"
|
||||||
|
) {
|
||||||
|
let q = (new URL(window.location)).searchParams.get("q");
|
||||||
|
if (q) {
|
||||||
|
console.log("Redirecting Bing search to Kagi.com");
|
||||||
|
window.location.href = "https://kagi.com/search?q=" + q;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Kagi for Safari (DuckDuckGo redirect)
|
// @name Kagi for Safari (DuckDuckGo redirect)
|
||||||
// @description Redirects DuckDuckGo searches to Kagi.com. Only relevant for desktop Safari users.
|
// @description Redirects DuckDuckGo searches to Kagi.com. Only relevant for desktop Safari users.
|
||||||
// @version 0.0.5
|
// @version 0.0.6
|
||||||
// @namespace jimeh.me
|
// @namespace jimeh.me
|
||||||
// @downloadURL https://github.com/jimeh/dotfiles/raw/main/userscripts/kagi-for-safari.user.js
|
// @downloadURL https://github.com/jimeh/dotfiles/raw/main/userscripts/kagi-for-safari-ddg.user.js
|
||||||
// @updateURL https://github.com/jimeh/dotfiles/raw/main/userscripts/kagi-for-safari.user.js
|
// @updateURL https://github.com/jimeh/dotfiles/raw/main/userscripts/kagi-for-safari-ddg.user.js
|
||||||
// @inject-into auto
|
// @inject-into auto
|
||||||
// @run-at document-start
|
// @run-at document-start
|
||||||
// @match https://duckduckgo.com/*
|
// @match https://duckduckgo.com/*
|
||||||
Reference in New Issue
Block a user