Detect Google container class for search filtering
Adding a check for div.MjjYud when injecting redirect button into Google search results. This helps resolve UI issues with non-traditional search results (like video results).pull/765/head
parent
e1096825c5
commit
a993538e8b
|
@ -272,9 +272,14 @@ function getSearchContainer(searchEngine, searchResult) {
|
|||
|
||||
switch (searchEngine) {
|
||||
case 'google':
|
||||
const closestGoogleContainerClass = searchResult.closest('div.MjjYud');
|
||||
const closestJsController = searchResult.closest('div[jscontroller]');
|
||||
const closestDataDiv = searchResult.closest('div[data-hveid].g') || searchResult.closest('div[data-hveid]');
|
||||
searchResultContainer = findClosestElement(searchResult, [closestJsController, closestDataDiv]);
|
||||
if (closestGoogleContainerClass) {
|
||||
searchResultContainer = closestGoogleContainerClass;
|
||||
} else {
|
||||
searchResultContainer = findClosestElement(searchResult, [closestJsController, closestDataDiv]);
|
||||
}
|
||||
break;
|
||||
case 'bing':
|
||||
searchResultContainer = searchResult.closest('li.b_algo');
|
||||
|
|
Loading…
Reference in New Issue