alecmev / trimless-gmail

Automatically shows trimmed content in Google Mail™
MIT License
15 stars 6 forks source link

1.10.4 Inconsistent #39

Open FortFun opened 5 years ago

FortFun commented 5 years ago

Thanks for all the work on 1.10.4 and the new Gmail. However, I am finding that it shows trimmed content on some of my emails but I still get the "show trimmed content" on some. What is even more confusing is that sometimes if I close and reopen the later emails, all the content is shown.

alecmev commented 5 years ago

Thanks for reporting! Unfortunately, this problem is as old as this extension. The root lies here:

https://github.com/jeremejevs/trimless-gmail/blob/7233f87f46da5b185817c171d48b5b12e1b27f01/contentScript.js#L13-L48

Every time something is clicked on the page, untrimming is launched. It scans the document for trimmed/clipped parts three times: immediately, 1 second later and 2 seconds later. After that it goes back to waiting. This works OK most of the time, but may be problematic on slow machines and/or slow internet connections, since if something loads after the scan at the 2-second mark, it won't get picked up and untrimmed. This heuristic is no good, and I'd probably implement it differently today, but I don't have time for a refactor, I'm afraid.

Do let me know if you believe your machine and your internet connection are good enough to load an email in under two seconds, then this may need further investigation.

Contributions are welcome, as always!

FortFun commented 5 years ago

Thanks for the explanation. But, I have a fast cable internet connection and a decent speed computer. Further, before Gmail changed and using the prior version of Trimless I did not have this issue. Appreciate any help!