Skip to content

Commit

Permalink
feat(google): dynamic switching on Google card layout (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
aug-dev committed May 26, 2024
1 parent 8f1b01d commit 7c7211b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/scripts/search-engines/google-desktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,24 @@ const desktopSerpHandlers: Record<string, SerpHandler> = {
}
},
},
// Small cards
{
target: ".e6hL7d:is(.WJXODe, .As9MV) > .I48dHb",
url: "a",
title: ".QzAn5, .F6sHsf",
actionTarget: ".N0RSzc, .QzAn5, .cHaqb",
actionPosition: "afterend",
actionStyle: {
padding: "0 12px",
fontSize: "10px",
marginBottom: "-6px",
position: "relative",
zIndex: "1",
textOverflow: "ellipsis",
overflow: "hidden",
whiteSpace: "nowrap",
},
},
// Twitter, Twitter Search
{
target: ".eejeod",
Expand Down Expand Up @@ -497,6 +515,11 @@ const desktopSerpHandlers: Record<string, SerpHandler> = {
innerTargets:
"[data-snf], [data-sokoban-feature], [data-content-feature], .IsZvec, .g, .iHxmLe, .d3zsgb, .rULfzc, .eA0Zlc.mkpRId.RLdvSe",
},
// Card layout dynamic switching
{
target: '[id^="stev-stapi"], [id^="stev-stapi"] > div',
innerTargets: ".I48dHb, .GHMsie, .ZHugbd",
},
],
}),
// Books
Expand Down

0 comments on commit 7c7211b

Please sign in to comment.