Skip to content

Commit 29e9f82

Browse files
committed
refactor
1 parent 8c6555a commit 29e9f82

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

extension/js/content_scripts/webmail/thunderbird/thunderbird-element-replacer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export class ThunderbirdElementReplacer extends WebmailElementReplacer {
2525
private emailBodyFromThunderbirdMail: string;
2626

2727
public getIntervalFunctions = (): IntervalFunction[] => {
28-
return [{ interval: 2000, handler: () => this.replaceThunderbirdMsgPane() }];
28+
return [{ interval: 2000, handler: () => this.handleThunderbirdMessageParsing() }];
2929
};
3030

31-
public replaceThunderbirdMsgPane = async () => {
31+
public handleThunderbirdMessageParsing = async () => {
3232
const emailBodyToParse = $('div.moz-text-plain').text().trim() || $('div.moz-text-html').text().trim();
3333
if (Catch.isThunderbirdMail()) {
3434
const pgpRegex = /-----BEGIN PGP MESSAGE-----(.*?)-----END PGP MESSAGE-----/s;

extension/js/content_scripts/webmail/thunderbird/thunderbird-webmail-startup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class ThunderbirdWebmailStartup {
1919

2020
private start = async () => {
2121
this.replacer = new ThunderbirdElementReplacer();
22-
this.replacer.runIntervalFunctionsPeriodically();
22+
// doesn't need hearbeat-like content replacer as the extension noticeably slows the Thunderbird client.
23+
await this.replacer.handleThunderbirdMessageParsing();
2324
// todo: show notification using Thunderbird Notification as contentscript notification or such does not work.
2425
// await notifications.showInitial(acctEmail);
2526
// notifications.show(

0 commit comments

Comments
 (0)