Google show original search result translated

show original search result translated in google

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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.

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

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            Google show original search result translated
// @namespace       https://greasyfork.org/users/821661
// @version         1.0
// @description     show original search result translated in google
// @author          hdyzen
// @match           https://www.google.*/search*
// @icon            https://www.google.com/s2/favicons?domain=https://www.google.com/&sz=64
// @grant           GM_addStyle
// @run-at          document-start
// @license         GPL-3.0-only
// ==/UserScript==

if (typeof GM_addStyle === "undefined") {
    window.GM_addStyle = (css) => {
        const node = document.head || document.documentElement;
        node.insertAdjacentHTML("beforeend", `<style>${css}</style>`);
    };
}

GM_addStyle(`
a[data-tli][href] {
    &[lang] {
        display: inline !important;
    }

    &:not([lang]) {
        display: none !important;
    }
}

div[lang] div[lang]:has([d^="M12.87 15."]) {
    display: none !important;
}
`);