Skip to content

feat(userscripts): update google search sidebar for current DOM#18

Merged
denolfe merged 1 commit into
mainfrom
userscripts/google-search-sidebar
May 10, 2026
Merged

feat(userscripts): update google search sidebar for current DOM#18
denolfe merged 1 commit into
mainfrom
userscripts/google-search-sidebar

Conversation

@denolfe
Copy link
Copy Markdown
Owner

@denolfe denolfe commented May 10, 2026

Overview

Updates the Google Search Sidebar userscript to work with Google's current (2026) DOM structure. The original script by Jimmy Lin stopped working after Google restructured their search tools UI.

image

Key Changes

  • Updated CSS selectors for current Google DOM

    • Replaced #hdtbMenus with #top_nav #hdtb and related selectors
    • Targets .pZvJc, .XhWQv.sjVJQd, .vH6rvf.FJCJfd for filter menus
  • Persistent sidebar with time/verbatim filters

    • Fixed position sidebar on the left showing expanded filter options
    • Shifts main content right to accommodate the sidebar
    • Transparent background to avoid visual clutter
  • Search term highlighting

    • Highlights <em> tags (search terms) with the primary color (#ff6a34)
  • Scope limited to "All" results

    • Excludes Image, Video, News, Shopping searches via tbm= and udm= URL params

Design Decisions

The script uses CSS-only approach (same as the original) for maximum compatibility and minimal overhead. The sidebar overlays on top of the page and shifts the main content rather than being positioned absolutely, which handles responsive layouts better.

Selectors target Google's current class names which may change over time. The script runs at document-start to inject styles before render, preventing layout shift.

- Update selectors to match Google's 2026 DOM structure
- Add persistent left sidebar with time/verbatim filters
- Highlight search terms with primary color (#ff6a34)
- Only run on "All" results (exclude Images, Videos, etc.)
- Shift main content to accommodate sidebar
@denolfe denolfe merged commit bade97e into main May 10, 2026
6 checks passed
@denolfe denolfe deleted the userscripts/google-search-sidebar branch May 10, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant