Closed maciex closed 2 years ago
It seems that el
is null
in that are.
I did a quick debug and it seems the document.querySelector()
method returns null
:
ROW_QUERY = '[data-testid="message-container"]';
> '[data-testid="message-container"]'
let el = document.querySelector(ROW_QUERY);
> undefined
I also checked on other chats, but got the same null
result
Thanks for the clear replication of the bug. I'm running into issues on my end as well so I can replicate. I'll try and fix this soon but as usual super busy. Might be able to do this next weekend
@theahura let me know if there's any code or even a snippet I could check (I can rerun it in dev mode).
I'm almost positive this is a simple bugfix. There's a list of queries at the top of main.js, one of those queries is no longer valid (probably the one for ROW), and I just need to replace it with a query that does work https://github.com/theahura/shoot-the-messenger/blob/main/main.js#L8
I changed l8 and l9 with the following, It works, not sure if it works for others? Works as it always had with this code though.
ROW_QUERY = '.x63ui4o.x18i3tt1.x6ikm8r.x10wlt62'; MY_ROW_QUERY = '.x6prxxf.x1fc57z9.x1yc453h.x126k92a.x14ctfv';
This worked for me. I mean most of the messages were unsent. The script ended with error in console (keep in mind that I added the new queries as new lines, so the line numbers are shifted +2):
main.js:206 Removed all holders.
main.js:242 No scroller or load buttons, but we didnt hit the top. Failing.
main.js:384 Failed to complete removal.
Also one of the messages in the chat was not deleted (this is the first message in the conversation).
It seems the script has problems with detecting that new messages should be loaded or we're not on the top message.
I tricked the script to go through all the messages but not delete them. And it fails with the same message (this time the lines should match the source code in master
):
main.js:204 Removed all holders.
main.js:240 No scroller or load buttons, but we didnt hit the top. Failing.
main.js:382 Failed to complete removal.
I think this means the MESSAGE_CONTAINER_QUERY is also busted
It seems the script has problems with detecting that new messages should be loaded or we're not on the top message.
I tricked the script to go through all the messages but not delete them. And it fails with the same message (this time the lines should match the source code in
master
):main.js:204 Removed all holders. main.js:240 No scroller or load buttons, but we didnt hit the top. Failing. main.js:382 Failed to complete removal.
I opened a pull request with a version that should fix all current issues.
Merged. Thanks a ton @10SecSleeper !
Describe the bug Extension did work few times during the tests. But after few tries it stopped working. Errors being logged in dev console.
To Reproduce Steps to reproduce the behavior:
Expected behavior Messages deleted in the chat.
Screenshots
Desktop (please complete the following information):
Logs