From aafaaee90452f2ee03f646994a1469acc948f3d2 Mon Sep 17 00:00:00 2001 From: Vipra Date: Tue, 21 May 2024 18:19:14 +0200 Subject: [PATCH 1/5] do not add proplates on account--minimal new div around element showing the currently logged in user --- src/libs/protootshelpers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/protootshelpers.js b/src/libs/protootshelpers.js index ff664ab..47666b4 100644 --- a/src/libs/protootshelpers.js +++ b/src/libs/protootshelpers.js @@ -51,7 +51,10 @@ export function addTypeAttribute(ActionElement) { } else if (hasClasses(ActionElement, "notification", "notification__message")) { ActionElement.setAttribute("protoots-type", "notification"); ActionElement.closest("article").setAttribute("protoots-type", "notification"); - } else if (hasClasses(ActionElement, "account")) { + } else if ( + hasClasses(ActionElement, "account") && + !hasClasses(ActionElement, "account--minimal") + ) { ActionElement.setAttribute("protoots-type", "account"); ActionElement.closest("article").setAttribute("protoots-type", "account"); } From f2ebb949f93e631270e9aee960ed7ab8460dbc37 Mon Sep 17 00:00:00 2001 From: Vipra Date: Tue, 21 May 2024 19:10:44 +0200 Subject: [PATCH 2/5] don't add "status focusable"s to the processing stack causes double proplates in certain cases on mastodon v4.3 --- src/content_scripts/protoots.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content_scripts/protoots.js b/src/content_scripts/protoots.js index 32204d3..9be013c 100644 --- a/src/content_scripts/protoots.js +++ b/src/content_scripts/protoots.js @@ -149,6 +149,10 @@ function addtoTootObserver(ActionElement, tootObserver) { // console.log(ActionElement); if (ActionElement.hasAttribute("protoots-tracked")) return; + // special case for Mastodon v4.3 where "status__wrapper" are created + // as "status focusable" after navigating back to timeline + if (hasClasses(ActionElement, "status") && hasClasses(ActionElement, "focusable")) return; + addTypeAttribute(ActionElement); ActionElement.setAttribute("protoots-tracked", "true"); tootObserver.observe(ActionElement); From 88922716d9c010a38fa5fc0036524bd6028c845e Mon Sep 17 00:00:00 2001 From: Vipra Date: Tue, 21 May 2024 19:10:44 +0200 Subject: [PATCH 3/5] only add specific status- classes to processing (status-public, status-unlisted, etc.) adding generic status class causes double proplates on Mastodon v4.3 in some cases --- src/content_scripts/protoots.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/content_scripts/protoots.js b/src/content_scripts/protoots.js index 9be013c..633ed9b 100644 --- a/src/content_scripts/protoots.js +++ b/src/content_scripts/protoots.js @@ -89,7 +89,10 @@ function main() { hasClasses( n, "detailed-status", - "status", + "status-public", + "status-unlisted", + "status-private", + "status-direct", "conversation", "account-authorize", "notification", From 03b2da430d9322ea6a29c17efdf1188f2cc81454 Mon Sep 17 00:00:00 2001 From: Vipra Date: Thu, 23 May 2024 10:49:55 +0200 Subject: [PATCH 4/5] bump version number --- src/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manifest.json b/src/manifest.json index 3abb1e8..a391630 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "ProToots", - "version": "1.2.2", + "version": "1.2.3", "icons": { "48": "icons/icon small_size/icon small_size.png", From 5af0befae1039825b44a114d8042d79ea14a7a78 Mon Sep 17 00:00:00 2001 From: Vipra Date: Thu, 23 May 2024 10:53:56 +0200 Subject: [PATCH 5/5] remove code i wanted to remove in an earlier commit git is confusing :c --- src/content_scripts/protoots.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/content_scripts/protoots.js b/src/content_scripts/protoots.js index 633ed9b..e863cae 100644 --- a/src/content_scripts/protoots.js +++ b/src/content_scripts/protoots.js @@ -152,10 +152,6 @@ function addtoTootObserver(ActionElement, tootObserver) { // console.log(ActionElement); if (ActionElement.hasAttribute("protoots-tracked")) return; - // special case for Mastodon v4.3 where "status__wrapper" are created - // as "status focusable" after navigating back to timeline - if (hasClasses(ActionElement, "status") && hasClasses(ActionElement, "focusable")) return; - addTypeAttribute(ActionElement); ActionElement.setAttribute("protoots-tracked", "true"); tootObserver.observe(ActionElement);