您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
GToggle can change google search language result between
当前为
// ==UserScript== // @name GSeach Toggle Persian/English // @name:fa سوییچ فارسی/انگلیسی گوگل // @homepage https://github.com/Soheyl // @author Soheyl // @version 0.1 // @description GToggle can change google search language result between // English and Persian without any effect in RTL direction. (fork as tgxhx) // @description:fa با این اسکریپت به راحتی میتوان بین زبان انگلیسی و فارسی // در جستجوی گوگل سوییچ کرد، البته بدون تغییر در چینش // صفحه از چپ به راست. // @namespace M.Khani // @match https://www.google.com/search* // @grant none // ==/UserScript== (function() { 'use strict'; const settingsBtn = document.querySelector('#abar_button_opt'); const settingsBtnParent = settingsBtn.parentElement; const a = document.createElement('a'); const query = new URLSearchParams(decodeURIComponent(location.search)); const isFarsi = (query.get('lr') || '').toLowerCase() === 'lang_fa'; if (isFarsi) { query.delete('lr'); query.delete('tbs'); a.textContent = 'English'; } else { query.set('lr', 'lang_fa'); query.set('tbs', 'lr:lang_1fa'); a.textContent = 'Persian'; } const href = `${location.origin}${location.pathname}?${query.toString()}`; a.setAttribute('href', href); a.classList.add('hdtb-tl'); a.style.cssText = 'color: #5f6368;text-decoration: none;' settingsBtnParent.insertBefore(a, settingsBtn) Object.assign(settingsBtnParent.style, { height: '100%', display: 'flex', 'align-items': 'baseline' }) Object.assign(settingsBtnParent.parentElement.style, { flex: 1, display: 'flex', 'justify-content': 'flex-end', 'align-items': 'baseline' }) })();