-
Notifications
You must be signed in to change notification settings - Fork 51
#5667 Added message decryption on Thunderbird #5796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
08cc689
dd6b230
87dea43
951f944
24e73d0
eb5a1b0
cd8dbb9
c4467b6
79c33b7
8ad4a5e
183dfed
9e061d4
8cbe0ea
e015143
3462ce6
8b44889
518d38b
f3f99ab
1472fd5
92b3263
9afaf6e
abf898b
f901bc5
ab34c37
b719396
fd54d62
c19f7f4
8cf725f
25df0e6
20a8b03
2cd3e47
7565afb
f89e496
ba0ed46
cc7aba4
0dddb00
cf24357
adafaa9
8fba4f2
3203a2f
53589ef
50ea4aa
d78693c
909684c
cb7765f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import { ContactStore } from '../common/platform/store/contact-store.js'; | |
import { Api } from '../common/api/shared/api.js'; | ||
import { ExpirationCache } from '../common/core/expiration-cache.js'; | ||
import { GoogleOAuth } from '../common/api/authentication/google/google-oauth.js'; | ||
import { Url, Str } from '../common/core/common.js'; | ||
|
||
export class BgHandlers { | ||
public static openSettingsPageHandler: Bm.AsyncResponselessHandler = async ({ page, path, pageUrlParams, addNewAcct, acctEmail }: Bm.Settings) => { | ||
|
@@ -106,4 +107,45 @@ export class BgHandlers { | |
} | ||
}); | ||
}); | ||
|
||
public static thunderbirdSecureComposeHandler = () => { | ||
const handleClickEvent = async (tabId: number, acctEmail: string, thunderbirdMsgId: number, composeMethod?: messenger.compose._ComposeDetailsType) => { | ||
const accountEmails = await GlobalStore.acctEmailsGet(); | ||
const useFullScreenSecureCompose = (await messenger.windows.getCurrent()).type === 'messageCompose'; | ||
composeMethod = composeMethod === 'reply' || composeMethod === 'forward' ? composeMethod : undefined; | ||
if (accountEmails.length !== 0) { | ||
await BgUtils.openExtensionTab( | ||
Url.create('/chrome/settings/inbox/inbox.htm', { acctEmail, useFullScreenSecureCompose, thunderbirdMsgId, composeMethod }) | ||
); | ||
await messenger.tabs.remove(tabId); | ||
} else { | ||
await BgUtils.openExtensionTab(Url.create('/chrome/settings/initial.htm', {})); | ||
} | ||
}; | ||
messenger.composeAction.onClicked.addListener(async tab => { | ||
const messageDetails = await messenger.compose.getComposeDetails(Number(tab.id)); | ||
const composeMethod = messageDetails.type; | ||
const msgId = Number(messageDetails.relatedMessageId); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const acctEmail = Str.parseEmail(messageDetails.from as string).email!; | ||
await handleClickEvent(Number(tab.id), acctEmail, msgId, composeMethod); | ||
}); | ||
messenger.messageDisplayAction.onClicked.addListener(async tab => { | ||
const tabId = Number(tab.id); | ||
const messageDetails = await messenger.messageDisplay.getDisplayedMessage(tabId); | ||
if (messageDetails) { | ||
const msgId = messageDetails.id; | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const acctEmail = (await messenger.accounts.get(messageDetails.folder!.accountId)).name; | ||
await handleClickEvent(tabId, acctEmail, msgId); | ||
} | ||
}); | ||
}; | ||
|
||
public static thunderbirdContentScriptRegistration = async () => { | ||
await messenger.messageDisplayScripts.register({ | ||
js: [{ file: './js/content_scripts/thunderbird-content-script.js' }], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after build changes all extension versions (not only thunderbird), include additional ![]() for browsers we use injectFcIntoWebmail method which adds all needed files to each gmail tab. do you think it'll be possible to adapt this method for thunderbird? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah, yes - sorry about that. I'll find a way a viable alternative solution to it from which There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's start with trying to adapt injectFcIntoWebmail method to inject all needed scripts into thunderbird, so it'll work the same in browsers and thunderbird. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @sosnovsky - I tried to adapt using injectFcIntoWebmail and there are incompatibility that prevents me from somehow make it work as close as how it works on browser. For example, in Thunderbird, registration for content script is done within However, I have done my best to achieve the best result while still complying with the requirements, which I believe I have accomplished in this PR. Please review and test it out. From my perspective, the results are extremely positive, and I'm excited to hear your feedback. :) Thanks for your help. |
||
css: [{ file: './css/cryptup.css' }], | ||
}); | ||
}; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.