// ==UserScript== // @name Google Search Tools to Sidebar // @namespace https://greasyfork.org/users/137 // @version 7.0.1 // @description Always expands the search tool and moves it back to the left side (legacy feature). // @author 100の人 // @homepageURL https://greasyfork.org/scripts/412326 // @license MPL-2.0 // @grant GM_addStyle // @run-at document-start // @match *://*/* // @downloadURL https://update.greasyfork.icu/scripts/412326/Google%20Search%20Tools%20to%20Sidebar.user.js // @updateURL https://update.greasyfork.icu/scripts/412326/Google%20Search%20Tools%20to%20Sidebar.meta.js // ==/UserScript== (function() { let css = ""; css += ` @namespace url(http://www.w3.org/1999/xhtml); /* デバッグ用URL AI による概要 https://www.google.com/search?q=AI+%E3%81%AB%E3%82%88%E3%82%8B%E6%A6%82%E8%A6%81 YouTube Music https://www.google.co.jp/search?q=%E3%81%BE%E3%81%BE%E3%81%94%E3%81%A8+%E5%80%89%E6%A9%8B%E3%83%A8%E3%82%A8%E3%82%B3 歌詞 https://www.google.co.jp/search?q=trick+and+treat+%E6%AD%8C%E8%A9%9E アニメなど https://www.google.com/search?q=%E5%A4%A2%E3%81%AE%E3%82%AF%E3%83%AC%E3%83%A8%E3%83%B3%E7%8E%8B%E5%9B%BD 「摂氏」「華氏」のサイドバー https://www.google.co.jp/search?q=%E6%91%82%E6%B0%8F */ `; if (location.href === "https://www.google.com/search?q=Greasy%20Fork" || location.href === "https://www.google.co.jp/search?q=Greasy%20Fork") { css += `/* Greasy Forkの適用サイト用 */ regexp("https?://www\\\\.google\\\\.(?:com|(?:com?\\\\.)?[a-z][a-z])/(?!(?:webhp$|$)|maps(?:$|.*)|search\\\\?(.*&)?(?:tbm=lcl|tbs=lrf|udm=2)(?:$|.*)).*") { @media (min-width: 1590px) { /*------------------------------------ 検索ツール全体 */ #top_nav { position: absolute; z-index: 3; padding-left: 0.5em; } #top_nav #hdtbMenus { display: unset; position: unset; } #top_nav #hdtbMenus > div { display: revert; } #top_nav #hdtbMenus > div > [id] { flex-direction: column; } [id^="tools_"], /* 「ツール」ボタン */ #appbar { /* 元々の検索ツールの表示領域 */ display: none; } /*------------------------------------ 各項目の見出し */ #top_nav #hdtbMenus g-popup > [role="button"] { display: none; } /* 日付けで期間が指定されているとき */ #top_nav #hdtbMenus g-popup:has(g-dialog) > [role="button"]:has(> div > [class*=" "]) { display: block; } #top_nav #hdtbMenus g-popup:has(g-dialog) > [role="button"]:has(> div > [class*=" "]) * { padding: unset; line-height: unset; white-space: wrap; } #top_nav #hdtbMenus g-popup:has(g-dialog) [role="button"] > div > [class*=" "] > span { /* ▼ */ display: none; } /*------------------------------------ 各項目の選択肢一覧 */ #top_nav #hdtbMenus [jsname][style*="display:none"]:not([aria-hidden]) { display: block !important; position: unset; box-shadow: unset; /* 日付けで期間が指定されているときに、表示されている期間をクリックしたとき */ min-width: unset !important; } /*------------------------------------ 検索ツールの各項目の選択肢 */ #top_nav #hdtbMenus g-popup > [role="button"], #top_nav #hdtbMenus g-menu-item { background: unset; } #top_nav #hdtbMenus g-menu-item:hover { text-decoration: underline; } #top_nav #hdtbMenus g-menu-item [aria-checked="true"], #top_nav #hdtbMenus g-popup:has(g-dialog) > [role="button"] > div > [class*=" "] /* 日付けで期間が指定されているとき */ { /* 選択されている選択肢 */ color: #DD4B39; font-weight: bold; } #top_nav #hdtbMenus g-menu-item > * > * { padding: unset; } } `; } if (typeof GM_addStyle !== "undefined") { GM_addStyle(css); } else { const styleNode = document.createElement("style"); styleNode.appendChild(document.createTextNode(css)); (document.querySelector("head") || document.documentElement).appendChild(styleNode); } })();