Closed Thie1e closed 1 year ago
so there's definitely a bug here:
main.js:83 Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'scrollTop' in null
at getScroller (main.js:83:24)
at prepareDOMForRemoval (main.js:133:3)
at unsendAllVisibleMessages (main.js:162:36)
at runner (main.js:285:29)
at removeHandler (main.js:393:24)
this occurs when the tool is unable to find the scrollbar, and as a result can't actually scroll up. The associated function is here: https://github.com/theahura/shoot-the-messenger/blob/main/main.js#L79
The way StM finds the messenger scrollbar is by using a query that selects for any of your messages OR any of the receivers messages OR any unsent messages. It grabs the first one and then tries to go up the DOM till it finds the scrollbar. I've generally found this pretty foolproof, but sometimes it will break if fb changes the class names and so on in the DOM.
Unfortunately I can't replicate this on my end :thinking: It's possible though that you're on a version of fb messenger where NONE of those queries work. The queries are here: https://github.com/theahura/shoot-the-messenger/blob/main/main.js#L11C1-L15C1
MY_ROW_QUERY = '.x78zum5.xdt5ytf.x193iq5w.x1n2onr6.xuk3077:has(> span)'; // Also used for finding the scroller (we just go up to the first parent w/ scrollTop)
PARTNER_CHAT_QUERY = '.x6prxxf.x1fc57z9.x1yc453h.x126k92a.xzsf02u'; // Partner chat text innerText, used for searching
UNSENT_MESSAGE_QUERY = '[aria-label="You unsent a message"]'; // In case a user has none of their own messages on screen and only unsent messages, this serves to pick up the scroll parent.
Debugging is tricky since I can't replicate. If you don't mind, could you run the following script in your console? See if anything pops up?
const MY_ROW_QUERY = '.x78zum5.xdt5ytf.x193iq5w.x1n2onr6.xuk3077:has(> span)';
const PARTNER_CHAT_QUERY = '.x6prxxf.x1fc57z9.x1yc453h.x126k92a.xzsf02u';
const UNSENT_MESSAGE_QUERY = '[aria-label="You unsent a message"]';
const elements = document.querySelectorAll(`${MY_ROW_QUERY}, ${PARTNER_CHAT_QUERY}, ${UNSENT_MESSAGE_QUERY}`);
console.log(elements)
Hi, thanks for your quick reply.
I don't know anything about web-development, so here is the copy-paste of the script and the output. Hopefully this helps:
const MY_ROW_QUERY = '.x78zum5.xdt5ytf.x193iq5w.x1n2onr6.xuk3077:has(> span)'; const PARTNER_CHAT_QUERY = '.x6prxxf.x1fc57z9.x1yc453h.x126k92a.xzsf02u'; const UNSENT_MESSAGE_QUERY = '[aria-label="You unsent a message"]';
const elements = document.querySelectorAll(${MY_ROW_QUERY}, ${PARTNER_CHAT_QUERY}, ${UNSENT_MESSAGE_QUERY}
);
console.log(elements)
VM658:7 NodeList(8) [div.x6prxxf.x1fc57z9.x1yc453h.x126k92a.xzsf02u, div.x78zum5.xdt5ytf.x193iq5w.x1n2onr6.xuk3077, div.x1n2xptk.xkbpzyx.xdppsyt.x1rr5fae.x1gn5b1j.x230xth.x1g8br2z.x1tlxs6b.x1dntmbh.x193iq5w.x889kno.…, div.x6prxxf.x1fc57z9.x1yc453h.x126k92a.xzsf02u, div.x1n2xptk.xkbpzyx.xdppsyt.x1rr5fae.x1gn5b1j.x230xth.x1g8br2z.x1tlxs6b.x1dntmbh.x193iq5w.x889kno.…, div.x1n2xptk.xkbpzyx.xdppsyt.x1rr5fae.x1gn5b1j.x230xth.x1g8br2z.x1tlxs6b.x1dntmbh.x193iq5w.x889kno.…, div.x78zum5.xdt5ytf.x193iq5w.x1n2onr6.xuk3077, div.x78zum5.xdt5ytf.x193iq5w.x1n2onr6.xuk3077]
Did this maybe not work in my testing because I was using it on a short chat that does not have a scrollbar at all? I think that's the problem.
Ah! that would do it. My recommendation: try testing it in a messenger chat to yourself with a bunch of random messages in it. I just type test
over and over when im testing
OK, this was easier to troubleshoot than expexted :-) The plugin unsent >20k messages in about 24 hours.
I had to restart it several times, though, when it failed to skip to the part of the chat where it had left off using the search bar.
Maybe mention in the docs (if it is not mentioned already) that the plugin relies on the scrollbar. Otherwise other people might use it on short chats for testing as well.
Thanks again.
Describe the bug When using the extension on Chrome on messenger.com, unsending messages does not work (nothing happens). I could only remove messages from a very old chat that stayed visible to the other person.
To Reproduce Steps to reproduce the behavior:
Expected behavior That the extension clicks sequentially through the chat and unsends messages, so they become invisible to the other person.
Desktop (please complete the following information):
Thanks for your work and enjoy the coffee :-) These are the logs after clicking remove:
Logs