From 545d1141f0e2424b982ab4464432bd0bd052c1de Mon Sep 17 00:00:00 2001 From: Raphael Wegmueller Date: Fri, 24 May 2024 13:55:37 +0200 Subject: [PATCH] fix(bulk): broken gdrive type detection (#744) --- src/extension/module.js | 2 +- test/fixtures/admin-gdrive.html | 28 +++++++--------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/extension/module.js b/src/extension/module.js index 36933f092..52d60d691 100644 --- a/src/extension/module.js +++ b/src/extension/module.js @@ -1758,7 +1758,7 @@ import sampleRUM from './rum.js'; return [...document.querySelectorAll('#drive_main_page [role="row"][aria-selected="true"]')] // extract file name and type .map((row) => { - const typeHint = (row.querySelector(':scope div[role="gridcell"] > div:nth-child(2) > div > div[data-tooltip]') // list layout + const typeHint = (row.querySelector(':scope div[role="gridcell"] > div:nth-child(2) > div:nth-child(1)') // list layout || row.querySelector(':scope div[role="gridcell"]'))?.getAttribute('aria-label'); // grid layout let type = 'unknown'; if (typeHint) { diff --git a/test/fixtures/admin-gdrive.html b/test/fixtures/admin-gdrive.html index e0f231ac3..06c406872 100644 --- a/test/fixtures/admin-gdrive.html +++ b/test/fixtures/admin-gdrive.html @@ -9,9 +9,7 @@
-
-
folder
-
+
folder
@@ -20,9 +18,7 @@
-
-
file.pdf
-
+
file.pdf
@@ -31,9 +27,7 @@
-
-
document
-
+
document
@@ -42,9 +36,7 @@
-
-
spreadsheet
-
+
spreadsheet
@@ -53,9 +45,7 @@
-
-
document.docx
-
+
document.docx
@@ -64,9 +54,7 @@
-
-
spreadsheet.xlsx
-
+
spreadsheet.xlsx
@@ -75,9 +63,7 @@
-
-
foo/../bar
-
+
foo/../bar