From 0e512e7f04c417ccbe5910e1fc9e0f2930ca666a Mon Sep 17 00:00:00 2001 From: Morea Date: Sun, 21 Apr 2024 15:31:34 +0200 Subject: [PATCH] Support list view --- Find Unique Titles/dist/find.unique.titles.user.js | 4 +++- Find Unique Titles/src/trackers/AvistaZ.ts | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Find Unique Titles/dist/find.unique.titles.user.js b/Find Unique Titles/dist/find.unique.titles.user.js index d747992..57559f4 100644 --- a/Find Unique Titles/dist/find.unique.titles.user.js +++ b/Find Unique Titles/dist/find.unique.titles.user.js @@ -333,7 +333,9 @@ return url.includes("avistaz.to"); } async* getSearchRequest() { - const elements = Array.from(document.querySelector("#content-area > div.block > .row").children); + const rows = document.querySelectorAll("#content-area > div.block > .row"); + let elements = Array.from(rows); + if (1 === rows.length) elements = Array.from(rows.item(0).children); yield { total: elements.length }; diff --git a/Find Unique Titles/src/trackers/AvistaZ.ts b/Find Unique Titles/src/trackers/AvistaZ.ts index f2b10fe..181c175 100644 --- a/Find Unique Titles/src/trackers/AvistaZ.ts +++ b/Find Unique Titles/src/trackers/AvistaZ.ts @@ -19,9 +19,11 @@ export default class AvistaZ implements tracker { } async *getSearchRequest(): AsyncGenerator { - const elements = Array.from( - document.querySelector("#content-area > div.block > .row")!!.children - ); + const rows = document.querySelectorAll("#content-area > div.block > .row"); + let elements = Array.from(rows); + if (rows.length === 1) { + elements = Array.from(rows.item(0)!!.children); + } yield { total: elements.length, };