Jelajahi Sumber

Fix sharing menu conflicts with extensions (#9074)

Detect only the share menu that belongs directly to the share dropdown.
An extension can add an unrelated nested `.dropdown-menu`. The previous descendant selector then skipped share-menu creation, leaving share URL placeholders unreplaced.
Fixes #7820.
Co-authored-by: Gerard Alvear <gerard.alvear@logiqd.me>
Gerard Alvear Porras 12 jam lalu
induk
melakukan
2a42d79cda
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      p/scripts/main.js

+ 1 - 1
p/scripts/main.js

@@ -804,7 +804,7 @@ async function show_labels_menu(el) {
 
 function show_share_menu(el) {
 	const div = el.parentElement;
-	const dropdownMenu = div.querySelector('.dropdown-menu');
+	const dropdownMenu = div.querySelector(':scope > .dropdown-menu');
 
 	if (!dropdownMenu) {
 		const itemId = el.closest('.flux').dataset.entry;