Skip to content

Commit

Permalink
Updated to use compose action popups by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdulcet committed May 24, 2024
1 parent 1dd8f16 commit 0764c17
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 37 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Copyright © 2020 Teal Dulcet
Thunderbird add-on/MailExtension to easily and securely encrypt and upload large attachments to any [Send service instance](https://github.com/timvisee/send-instances/#instances) (formerly [Firefox Send](https://github.com/mozilla/send)) and send the links via e-mail using the [CloudFile/FileLink API](https://thunderbird-webextensions.readthedocs.io/en/latest/cloudFile.html). Firefox Send was [discontinued by Mozilla](https://support.mozilla.org/kb/what-happened-firefox-send) in 2020. It is now maintained by @timvisee and called just [Send](https://github.com/timvisee/send), but soon will be [resurrected by Thunderbird](https://youtu.be/zt_2xiNjQBo).

* Enables simple, yet private file sharing with end-to-end encryption
* Files are securely [encrypted](https://github.com/timvisee/send/blob/master/docs/encryption.md) and uploaded locally in Thunderbird using the [Web Crypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) and [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) APIs
* Files are securely [encrypted](https://github.com/timvisee/send/blob/master/docs/encryption.md) and uploaded locally in Thunderbird using the [Web Crypto](https://developer.mozilla.org/docs/Web/API/Web_Crypto_API) and [WebSocket](https://developer.mozilla.org/docs/Web/API/WebSockets_API) APIs
* Files are encrypted and uploaded in chunks, so it requires very little memory (RAM) for even large files
* Links are automatically added to the e-mail by Thunderbird when uploads finish, which includes the encryption secret needed to decrypt the file
* When recipient clicks a link, the file will securely download and decrypt locally in their browser using that encryption secret
Expand All @@ -27,6 +27,7 @@ Thunderbird add-on/MailExtension to easily and securely encrypt and upload large
* Does NOT require a Firefox Account (FxA) or any other accounts, all uploads are anonymous
* Supports the light/dark mode of your system automatically
* Follows the [Thunderbird Photon Design](https://style.thunderbird.net/)
* Translated into two languages

More information on the encryption used can be found in the official Send service documentation [here](https://github.com/timvisee/send/blob/master/docs/encryption.md).

Expand All @@ -38,6 +39,12 @@ This add-on is not affiliated with Mozilla, Firefox or any Send service instance

## Contributing

### Translations

Translate the add-on using the online [WebExtension Translator](https://lusito.github.io/web-ext-translator/?gh=https://github.com/tdulcet/Thunderbird-Send/tree/main) and then open a pull request or issue with the resulting translations. Please see [this guide](https://github.com/TinyWebEx/common/blob/master/CONTRIBUTING.md#translations) or the [official documentation](https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/Internationalization) for more information.

### Code

Pull requests welcome! Ideas for contributions:

* Convert to [Manifest V3](https://extensionworkshop.com/documentation/develop/manifest-v3-migration-guide/) (MV3)
Expand All @@ -53,4 +60,3 @@ Pull requests welcome! Ideas for contributions:
* Improve the performance
* Integrate this functionality into Thunderbird (see [Bug 1516252](https://bugzilla.mozilla.org/show_bug.cgi?id=1516252))
* Create a Firefox/Chrome add-on/WebExtension to both upload and download files
* Localize the add-on
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"message": "Use compose action popups"
},
"optionsPopupDesc": {
"message": "Use compose action popups in the compose window instead of standalone popup windows. Experimental and requires Thunderbird 115 or greater to automatically open the compose action popups."
"message": "Use compose action popups in the compose window instead of standalone popup windows. Requires Thunderbird 115 or greater to automatically open the compose action popups."
},
"optionsLinkLabel": {
"message": "Create link for Send service instance"
Expand Down
2 changes: 1 addition & 1 deletion _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"message": "Utiliser un panneau contextuel"
},
"optionsPopupDesc": {
"message": "La fenêtre contextuelle séparée sera remplacée par un panneau contextuel dans la fenêtre de composition. Cette fonction est expérimentale."
"message": "La fenêtre contextuelle séparée sera remplacée par un panneau contextuel dans la fenêtre de composition."
},
"optionsLinkLabel": {
"message": "Créer un lien vers l’instance Send"
Expand Down
4 changes: 2 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ async function uploaded(account, fileInfo, tab, relatedFileInfo) {

promiseMap.set(tabId, promise);

// await delay(1000);
await delay(1000);

await browser.composeAction.openPopup().catch((error) => {
console.error(error);
Expand Down Expand Up @@ -878,7 +878,7 @@ async function uploaded(account, fileInfo, tab, relatedFileInfo) {
console.timeEnd(id);

if (json.ok) {
notification(browser.i18n.getMessage("notifUploadDoneTitle"), `${browser.i18n.getMessage("notifUploadDoneMessage", getSecondsAsDigitalClock(Math.floor((end - start) / 1000)))}\n⬇️: ${numberFormat.format(upload.downloads)}\n⏲️: ${getSecondsAsDigitalClock(upload.time * 60)}\n\n${url}`);
notification(browser.i18n.getMessage("notifUploadDoneTitle"), `${browser.i18n.getMessage("notifUploadDoneMessage", [file.name, getSecondsAsDigitalClock(Math.floor((end - start) / 1000))])}\n⬇️: ${numberFormat.format(upload.downloads)}\n⏲️: ${getSecondsAsDigitalClock(upload.time * 60)}\n\n${url}`);
} else {
notification(browser.i18n.getMessage("notifUploadUnableTitle"), browser.i18n.getMessage("notifUploadErrorMessage", [file.name, json.error]));
}
Expand Down
2 changes: 1 addition & 1 deletion common/modules/data/DefaultSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const defaultSettings = {
settings: {
send: true,
composeAction: false,
composeAction: true,
link: false
},
account: {
Expand Down
26 changes: 26 additions & 0 deletions icons/blue_file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 23 additions & 9 deletions management/management.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@
<form>
<section>
<h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<p><a href="https://github.com/tdulcet/Thunderbird-Send" target="_blank"><button type="button" data-i18n="__MSG_infoButton__">ℹ️
<p><a href="https://github.com/tdulcet/Thunderbird-Send" target="_blank"><button type="button"
data-i18n="__MSG_infoButton__">ℹ️
Information</button></a>
<button type="button" id="settings" data-i18n="__MSG_optionsButton__">⚙️ Options</button>
<a href="https://www.tealdulcet.com/" target="_blank"><button type="button" data-i18n="__MSG_donateButton__">❤️ Donate</button></a>
<a href="https://www.tealdulcet.com/" target="_blank"><button type="button"
data-i18n="__MSG_donateButton__">❤️ Donate</button></a>
</p>
</section>

Expand All @@ -67,7 +69,9 @@ <h1 data-i18n="__MSG_manageTitle__">Account Settings</h1>
</span><br>
<hr>
<span class="helper-text" data-i18n="__MSG_manageGetList__" data-opt-i18n-keep-children>
Click this link for a list of <a data-i18n="__MSG_manageListLinkText__" href="https://github.com/timvisee/send-instances/#instances" target="_blank">public Send service instances</a> and their respective maximum file size.
Click this link for a list of <a data-i18n="__MSG_manageListLinkText__"
href="https://github.com/timvisee/send-instances/#instances" target="_blank">public Send service
instances</a> and their respective maximum file size.
</span>

<ul>
Expand All @@ -94,8 +98,9 @@ <h1 data-i18n="__MSG_manageTitle__">Account Settings</h1>
<option value="100">
</datalist>
</div>
<span class="line indent helper-text" data-i18n="__MSG_manageDownloadLimitHelp__">The files will expire after this number of downloads. Make
sure it is less than the maximum downloads supported by this Send service instance.</span>
<span class="line indent helper-text" data-i18n="__MSG_manageDownloadLimitHelp__">The files will
expire after this number of downloads. Make sure it is less than the maximum downloads supported
by this Send service instance.</span>
</li>

<li>
Expand All @@ -112,8 +117,9 @@ <h1 data-i18n="__MSG_manageTitle__">Account Settings</h1>
<input class="setting save-on-change" type="number" id="minutes" data-optiongroup="account" name="time" min="0" required>
<label for="minutes" data-i18n="__MSG_manageMinutes__">minutes</label>
</div>
<span class="line indent helper-text" data-i18n="__MSG_manageTimeLimitHelp__">The files will expire after this time. Make sure it is less
than the maximum time supported by this Send service instance.</span>
<span class="line indent helper-text" data-i18n="__MSG_manageTimeLimitHelp__">The files will expire
after this time. Make sure it is less than the maximum time supported by this Send service
instance.</span>
</li>

<li>
Expand All @@ -122,8 +128,8 @@ <h1 data-i18n="__MSG_manageTitle__">Account Settings</h1>
<input class="setting save-on-change" type="number" id="size" data-optiongroup="account" name="size" required>
<label for="size" data-i18n="__MSG_manageGiB__">GiB</label>
</div>
<span class="line indent helper-text" data-i18n="__MSG_manageMaxSizeHelp__">Maximum file size supported by this Send service
instance.</span>
<span class="line indent helper-text" data-i18n="__MSG_manageMaxSizeHelp__">Maximum file size
supported by this Send service instance.</span>
</li>
</ul>
</section>
Expand All @@ -132,6 +138,14 @@ <h1 data-i18n="__MSG_manageTitle__">Account Settings</h1>
<hr /><br />
<button type="button" id="resetButton" data-i18n="__MSG_resetButton__">Reset all settings to defaults</button>
</div>

<p class="helper-text">
<span data-i18n="__MSG_translatorCredit__" data-opt-i18n-keep-children>
This add-on has been translated into English by
<a data-i18n="__MSG_translatorUsername__" data-i18n-href="__MSG_translatorLink__"
href="https://github.com/tdulcet">Teal Dulcet</a>.
</span>
</p>
</form>
</body>

Expand Down
30 changes: 21 additions & 9 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@
<form>
<section>
<h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<p><a href="https://github.com/tdulcet/Thunderbird-Send" target="_blank"><button data-i18n="__MSG_infoButton__" type="button">ℹ️
<p><a href="https://github.com/tdulcet/Thunderbird-Send" target="_blank"><button
data-i18n="__MSG_infoButton__" type="button">ℹ️
Information</button></a>
<a href="https://www.tealdulcet.com/" target="_blank"><button data-i18n="__MSG_donateButton__" type="button">❤️ Donate</button></a>
<a href="https://www.tealdulcet.com/" target="_blank"><button data-i18n="__MSG_donateButton__"
type="button">❤️ Donate</button></a>
</p>
</section>

Expand All @@ -77,20 +79,22 @@ <h1 data-i18n="__MSG_optionsTitle__">Options</h1>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="composeAction" data-optiongroup="settings" name="composeAction">
<label for="composeAction" data-i18n="__MSG_optionsPopupLabel__">Use compose action popups</label>
<label for="composeAction" data-i18n="__MSG_optionsPopupLabel__">Use compose action
popups</label>
</div>
<span class="line indent helper-text" data-i18n="__MSG_optionsPopupDesc__">Use compose action popups in the compose window instead of
standalone popup windows. Experimental and requires Thunderbird 115 or greater to automatically
open the compose action popups.</span>
<span class="line indent helper-text" data-i18n="__MSG_optionsPopupDesc__">Use compose action popups
in the compose window instead of standalone popup windows. Requires Thunderbird 115 or greater
to automatically open the compose action popups.</span>
</li>

<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="link" data-optiongroup="settings" name="link">
<label for="link" data-i18n="__MSG_optionsLinkLabel__">Create link for Send service instance</label>
<label for="link" data-i18n="__MSG_optionsLinkLabel__">Create link for Send service
instance</label>
</div>
<span class="line indent helper-text" data-i18n="__MSG_optionsLinkDesc__">Adds a “Learn more about” link for the Send service instance
to footer of messages.</span>
<span class="line indent helper-text" data-i18n="__MSG_optionsLinkDesc__">Adds a “Learn more about”
link for the Send service instance to footer of messages.</span>
</li>
</ul>
</section>
Expand All @@ -99,6 +103,14 @@ <h1 data-i18n="__MSG_optionsTitle__">Options</h1>
<hr /><br />
<button type="button" id="resetButton" data-i18n="__MSG_resetButton__">Reset all settings to defaults</button>
</div>

<p class="helper-text">
<span data-i18n="__MSG_translatorCredit__" data-opt-i18n-keep-children>
This add-on has been translated into English by
<a data-i18n="__MSG_translatorUsername__" data-i18n-href="__MSG_translatorLink__"
href="https://github.com/tdulcet">Teal Dulcet</a>.
</span>
</p>
</form>
</body>

Expand Down
31 changes: 19 additions & 12 deletions popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
<form id="form">
<section>
<h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<p><a href="https://github.com/tdulcet/Thunderbird-Send" target="_blank"><button data-i18n="__MSG_infoButton__" type="button">ℹ️
<p><a href="https://github.com/tdulcet/Thunderbird-Send" target="_blank"><button
data-i18n="__MSG_infoButton__" type="button">ℹ️
Information</button></a>
<button data-i18n="__MSG_optionsButton__" type="button" id="settings">⚙️ Options</button>
<a href="https://www.tealdulcet.com/" target="_blank"><button data-i18n="__MSG_donateButton__" type="button">❤️ Donate</button></a>
<a href="https://www.tealdulcet.com/" target="_blank"><button data-i18n="__MSG_donateButton__"
type="button">❤️ Donate</button></a>
</p>
<hr>
<div id="table"></div>
Expand Down Expand Up @@ -56,8 +58,9 @@ <h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<option value="100">
</datalist>
</div>
<span class="line indent helper-text" data-i18n="__MSG_popupDownloadLimitDesc__">The file will expire after this number of downloads. Make sure
it is less than the maximum downloads supported by this Send service instance.</span>
<span class="line indent helper-text" data-i18n="__MSG_popupDownloadLimitDesc__">The file will
expire after this number of downloads. Make sure it is less than the maximum downloads supported
by this Send service instance.</span>
</li>

<li>
Expand All @@ -70,18 +73,19 @@ <h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<input class="setting" type="number" id="minutes" name="time" min="0" size="10" required>
<label for="minutes" data-i18n="__MSG_popupMinutes__">minutes</label>
</div>
<span class="line indent helper-text" data-i18n="__MSG_popupTimeLimitDesc__">The file will expire after this time. Make sure it is less
than the maximum time supported by this Send service instance.</span>
<span class="line indent helper-text" data-i18n="__MSG_popupTimeLimitDesc__">The file will expire
after this time. Make sure it is less than the maximum time supported by this Send service
instance.</span>
</li>

<li>
<details>
<summary data-i18n="__MSG_popupPwdProtect__">Protect with password (click to add)</summary>
<div class="message-container">
<div aria-label="warning message" class="message-box warning">
<span class="message-text" data-i18n="__MSG_popupPwdWarning__">Use different methods to send the password and file to the
recipients. Including the password in the same e-mail as the link to the file does
not provide any additional security.</span>
<span class="message-text" data-i18n="__MSG_popupPwdWarning__">Use different methods to
send the password and file to the recipients. Including the password in the same
e-mail as the link to the file does not provide any additional security.</span>
</div>
</div>
<br>
Expand All @@ -91,14 +95,16 @@ <h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<input class="setting" type="checkbox" id="toggle" name="toggle">
<label for="toggle" data-i18n="__MSG_popupPwdShow__">Show password</label>
</div>
<span class="line indent helper-text" data-i18n="__MSG_popupPwdHelp__">Optionally protect the file with a password.</span>
<span class="line indent helper-text" data-i18n="__MSG_popupPwdHelp__">Optionally protect the
file with a password.</span>
<div class="line hidden" id="pronunciation">
<label for="text" data-i18n="__MSG_popupPwdPronunciation__">Password pronunciation</label>
<input class="setting" type="text" id="text" name="text" size="80" readonly>
</div>
<div class="line indent">
<details>
<summary data-i18n="__MSG_popupPwdSuggest__">Suggest strong password (click to show)</summary>
<summary data-i18n="__MSG_popupPwdSuggest__">Suggest strong password (click to show)
</summary>
<br>
<div class="line">
<select name="random" id="random">
Expand All @@ -115,7 +121,8 @@ <h3><img src="/icons/icon.svg" class="icon"> Thunderbird Send</h3>
<option data-i18n="__MSG_popupPwdGenOpt6__" data-i18n-title="__MSG_popupPwdGenOpt6Title__" value="6" title="Emoji password with only the basic emoji">Emoji
password (8)</option>
</select>
<button type="button" id="generate" data-i18n="__MSG_popupPwdGenButton__">🔒 Securely Generate</button>
<button type="button" id="generate" data-i18n="__MSG_popupPwdGenButton__">🔒
Securely Generate</button>
</div>
</details>
</div>
Expand Down

0 comments on commit 0764c17

Please sign in to comment.