Anti Filter Bubble

Google anti-filter engine:hide big tech globally, forums & pre-2015 filters search

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Anti Filter Bubble 
// @namespace    https://openweb-tools.example
// @version      1.0
// @description  Google anti-filter engine:hide big tech globally, forums & pre-2015 filters search 
// @match        https://www.google.*/*
// @grant        none
// @license      GPL-3.0-or-later
// @run-at       document-idle
// ==/UserScript==

/*
GPL v3
https://www.gnu.org/licenses/gpl-3.0.html
*/

(function () {
'use strict';

if (!location.href.includes("/search")) return;
if (document.getElementById("afb-v5")) return;

/* ---------- STORAGE ---------- */

const STORAGE = {
    hide: "afb_hide_bigtech",
    forums: "afb_forums",
    old: "afb_old"
};

/* ---------- STATE ---------- */

let hide = localStorage.getItem(STORAGE.hide) === "1";
let forums = localStorage.getItem(STORAGE.forums) === "1";
let old = localStorage.getItem(STORAGE.old) === "1";

/* ---------- CONFIG ---------- */

const BLOCK = [
"reddit.com","quora.com","youtube.com",
"facebook.com","instagram.com","tiktok.com",
"twitter.com","x.com","pinterest.com","medium.com"
];

/* ---------- HELPERS ---------- */

function preservePage(u){
    const current = new URL(location.href);
    const start = current.searchParams.get("start");
    if (start) u.searchParams.set("start", start);
}

/* ---------- UI (OFFSET LEFT) ---------- */

const panel = document.createElement("div");
panel.id = "afb-v5";

panel.style = `
position:fixed;
bottom:20px;
right:200px; /* <-- KEY FIX: shifted left from Deep Search Jumper */
z-index:999999;
background:rgba(0,0,0,0.9);
color:#0f0;
padding:10px;
border-radius:10px;
font-family:monospace;
font-size:12px;
box-shadow:0 0 10px rgba(0,0,0,.6);
`;

panel.innerHTML = `
<b>AntiFilter</b><br>

<button id="afb-hide">Hide BigTech</button>
<button id="afb-forum">Forums</button>
<button id="afb-old">Pre2015</button>
`;

document.body.appendChild(panel);

/* ---------- FILTER ---------- */

function applyFilter(){
    if (!hide) return;

    document.querySelectorAll("div.g, div.MjjYud").forEach(el=>{
        const a = el.querySelector("a");
        if (!a) return;

        if (BLOCK.some(d => a.href.includes(d))){
            el.style.display = "none";
        }
    });
}

/* ---------- BUTTONS ---------- */

document.getElementById("afb-hide").onclick = () => {
    hide = !hide;
    localStorage.setItem(STORAGE.hide, hide ? "1" : "0");
    applyFilter();
};

document.getElementById("afb-forum").onclick = () => {
    forums = !forums;
    localStorage.setItem(STORAGE.forums, forums ? "1" : "0");

    const u = new URL(location.href);
    let q = u.searchParams.get("q") || "";

    if (forums && !q.match(/\bforum\b/i)) q += " forum";
    if (!forums) q = q.replace(/\bforum\b/gi,"").trim();

    u.searchParams.set("q", q);
    preservePage(u);

    location.href = u.toString();
};

document.getElementById("afb-old").onclick = () => {
    old = !old;
    localStorage.setItem(STORAGE.old, old ? "1" : "0");

    const u = new URL(location.href);

    if (old){
        u.searchParams.set("tbs","cdr:1,cd_min:1/1/1990,cd_max:12/31/2014");
    } else {
        u.searchParams.delete("tbs");
    }

    preservePage(u);
    location.href = u.toString();
};

/* ---------- AUTO APPLY ---------- */

setInterval(applyFilter, 1200);

})();