ソースを参照

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 13 時間 前
コミット
2a42d79cda
1 ファイル変更1 行追加1 行削除
  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;