// This script redirects Bing searches to Google. // // IMPORTANT FIX (Edge Copilot new-tab autocomplete case): // When searching from Microsoft Edge’s new tab with Copilot/autocomplete, Bing often puts // what you typed into the "pq" parameter (partial query) and the Copilot-completed term // into the "q" parameter (final query). // // The old regex accidentally matched the "q" inside "pq" (e.g., pq=viole and q=violentmonkey), // so it redirected to Google with "viole" instead of the actual completed query "violentmonkey". // // To prevent this, we now match only the standalone "q" parameter (using a boundary like [?&]q=), // ensuring we use Bing’s final query. (We intentionally ignore "pq".)
var m = location.search.match(/[?&]q=([^&]+)/); if (m) location.replace("https://www.google.com/search?q=" + encodeURIComponent(decodeURIComponent(m[1].replace(/\+/g, " "))));
// This script redirects Bing searches to Google.
//
// IMPORTANT FIX (Edge Copilot new-tab autocomplete case):
// When searching from Microsoft Edge’s new tab with Copilot/autocomplete, Bing often puts
// what you typed into the "pq" parameter (partial query) and the Copilot-completed term
// into the "q" parameter (final query).
//
// The old regex accidentally matched the "q" inside "pq" (e.g., pq=viole and q=violentmonkey),
// so it redirected to Google with "viole" instead of the actual completed query "violentmonkey".
//
// To prevent this, we now match only the standalone "q" parameter (using a boundary like [?&]q=),
// ensuring we use Bing’s final query. (We intentionally ignore "pq".)
var m = location.search.match(/[?&]q=([^&]+)/);
if (m) location.replace("https://www.google.com/search?q=" + encodeURIComponent(decodeURIComponent(m[1].replace(/\+/g, " "))));