Hide StackOverflow in Google Search

hide stackoverflow. research independently.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Hide StackOverflow in Google Search
// @namespace    http://tampermonkey.net/
// @version      2024-12-23
// @description  hide stackoverflow. research independently.
// @author       You
// @match        https://www.google.com/**
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant        none
// @license      GPLv3
// ==/UserScript==

(function() {
    'use strict';
// the search area
    const area = document.querySelector("div#search")
    // the results
    const first_result = area.childNodes[0].childNodes[1].childNodes[0]
    const other_results = area.childNodes[0].childNodes[1].childNodes[2].childNodes
    let results = [first_result]
    for(let i=0; i<other_results.length; i++) {
        results.push(other_results[i])
    }
    for(let i=0; i<results.length; i++) {
        let spans = results[i].querySelectorAll("span + div > div >span")
        for(let j=0; j<spans.length; j++) {
            let span=spans[j];
            if (span.textContent === "Stack Overflow"|| span.textContent==="Ask Ubuntu" || span.textContent==="Super User" ) {
                console.log(results[i]);
                results[i].style.display = "none";
                break;
            }
        }
    }
})();