├── .eslintrc.json ├── .gitignore ├── CHANGELOG ├── CREDITS ├── LICENSE ├── README.md ├── chrome.manifest ├── chrome └── thunderlink │ └── content │ ├── preferences.js │ ├── preferences.xul │ ├── thunderlink-overlay.xul │ └── thunderlink.js ├── components └── thunderlinkCommandLineHandler.js ├── defaults └── preferences │ └── thunderlink.js ├── install.rdf ├── integration ├── ThunderLink_WIN10_64bit_Thunderbird_32bit.reg ├── ThunderLink_WIN7_64bit_Thunderbird_32bit.reg ├── ThunderLink_WINXP_WIN7_32bit_Thunderbird_32bit.reg ├── macosx │ ├── ThunderlinkOpener.app │ │ └── Contents │ │ │ ├── Info.plist │ │ │ ├── MacOS │ │ │ └── applet │ │ │ ├── PkgInfo │ │ │ └── Resources │ │ │ ├── Scripts │ │ │ └── main.scpt │ │ │ ├── ThunderlinkOpenerJS.scpt │ │ │ ├── applet.icns │ │ │ ├── applet.rsrc │ │ │ └── description.rtfd │ │ │ └── TXT.rtf │ ├── ThunderlinkOpener.scpt │ ├── ThunderlinkOpenerJS.scpt │ └── install.txt ├── open-message-uri.sh ├── thunderbird-message-tl.desktop └── thunderbird-tl.desktop ├── makeXpi.sh ├── manifest.json ├── modules └── thunderlinkModule.js ├── package-lock.json └── package.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "airbnb-base" 4 | ], 5 | "globals": { 6 | "Components": false, 7 | "document": false, 8 | "fixIterator": false, 9 | "gDBView": false, 10 | "GlodaUtils": false, 11 | "MailServices": false, 12 | "MailUtils": false, 13 | "window": false, 14 | "dump": false, 15 | "XPCOMUtils": false, 16 | "ChromeUtils": false 17 | }, 18 | "rules": { 19 | "camelcase": 0, 20 | "prefer-template": 0, 21 | "no-console": 0, 22 | "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], 23 | "no-param-reassign": ["error", { "props": true, "ignorePropertyModificationsFor": ["aCommandLine", "count"] }], 24 | "no-underscore-dangle": ["error", { "allowAfterThis": true }], 25 | "no-unused-vars": ["error", { 26 | "varsIgnorePattern": "NSGetFactory|MAPI_STARTUP_ARG", 27 | "argsIgnorePattern": "[iI]gnored" 28 | }], 29 | "no-var": 0, 30 | "object-shorthand": 0, 31 | "quotes": 0, 32 | "vars-on-top": 0, 33 | "prefer-destructuring": 0 34 | } 35 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | *.xpi 4 | node_modules 5 | .vscode 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | 1.2.10 2 | ------ 3 | - Ok button only for prefs, since they always save (@mikehardy) 4 | 5 | 1.2.9 6 | ----- 7 | - Fixed preference window on Windows (@mikehardy) 8 | 9 | 1.2.8 10 | ----- 11 | - Selection of multiple messages (@MarioKusek) 12 | - Fix error that disabled keyboard shortcuts (@MarioKusek) 13 | 14 | 1.2.7 15 | ----- 16 | - Mac Support (thanks @MarioKusek) 17 | - Date in templates (thanks @MarioKusek) 18 | - Append to file if wanted (thanks @MarioKusek) 19 | - Special characters in templates (thanks @MarioKusek) 20 | 21 | 1.2.6 22 | ----- 23 | - Compatibility up to Thunderbird 64.0b4 (@mikehardy) 24 | 25 | 1.2.5 26 | ----- 27 | - Compatibility down to Thunderbird 38.0 (@mikehardy) 28 | 29 | 1.2.4 30 | ----- 31 | - Compatibility down to Thunderbird 52.9 (@mikehardy) 32 | 33 | 1.2.3 34 | ----- 35 | - Improved OS integration scripts and documentation (@mikehardy) 36 | 37 | 1.2.2 38 | ----- 39 | - Compatibility up to Thunderbird 60 (@mikehardy) 40 | - Address add-ons code review issues (@mikehardy) 41 | - Add clickable links / Mail.app format (@mikehardy) 42 | - Integration / Documentation updates for new OS versions (@mikehardy @mobileartur) 43 | - Windows registry files (thanks @mobileartur) 44 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | Credit where credit is due 2 | -------------------------- 3 | 4 | If you have contributed and would like credit here, just ask! (or send a PR) 5 | 6 | -------------------------- 7 | 8 | Christoph Zwirello - original author - he created this thing! Awesome 9 | Anonymous contributors - prior to October 2018 I was not a maintainer so I'm unaware, sorry :-) 10 | Mike Hardy - current maintainer, ported to Thunderbird 64+ 11 | @mobileartur - contributing ready-to-use Windows registry files 12 | @MarioKusek - Mac support (complete with helper AppleScript) 13 | @MarioKusek - Support for in templates 14 | @MarioKusek - Support for some special characters in templates 15 | @MarioKusek - Add feature to append links to file 16 | @MarioKusek - Create links for more than one message at a time -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License, version 2.0 2 | 3 | 1. Definitions 4 | 5 | 1.1. “Contributor” 6 | 7 | means each individual or legal entity that creates, contributes to the 8 | creation of, or owns Covered Software. 9 | 10 | 1.2. “Contributor Version” 11 | 12 | means the combination of the Contributions of others (if any) used by a 13 | Contributor and that particular Contributor’s Contribution. 14 | 15 | 1.3. “Contribution” 16 | 17 | means Covered Software of a particular Contributor. 18 | 19 | 1.4. “Covered Software” 20 | 21 | means Source Code Form to which the initial Contributor has attached the 22 | notice in Exhibit A, the Executable Form of such Source Code Form, and 23 | Modifications of such Source Code Form, in each case including portions 24 | thereof. 25 | 26 | 1.5. “Incompatible With Secondary Licenses” 27 | means 28 | 29 | a. that the initial Contributor has attached the notice described in 30 | Exhibit B to the Covered Software; or 31 | 32 | b. that the Covered Software was made available under the terms of version 33 | 1.1 or earlier of the License, but not also under the terms of a 34 | Secondary License. 35 | 36 | 1.6. “Executable Form” 37 | 38 | means any form of the work other than Source Code Form. 39 | 40 | 1.7. “Larger Work” 41 | 42 | means a work that combines Covered Software with other material, in a separate 43 | file or files, that is not Covered Software. 44 | 45 | 1.8. “License” 46 | 47 | means this document. 48 | 49 | 1.9. “Licensable” 50 | 51 | means having the right to grant, to the maximum extent possible, whether at the 52 | time of the initial grant or subsequently, any and all of the rights conveyed by 53 | this License. 54 | 55 | 1.10. “Modifications” 56 | 57 | means any of the following: 58 | 59 | a. any file in Source Code Form that results from an addition to, deletion 60 | from, or modification of the contents of Covered Software; or 61 | 62 | b. any new file in Source Code Form that contains any Covered Software. 63 | 64 | 1.11. “Patent Claims” of a Contributor 65 | 66 | means any patent claim(s), including without limitation, method, process, 67 | and apparatus claims, in any patent Licensable by such Contributor that 68 | would be infringed, but for the grant of the License, by the making, 69 | using, selling, offering for sale, having made, import, or transfer of 70 | either its Contributions or its Contributor Version. 71 | 72 | 1.12. “Secondary License” 73 | 74 | means either the GNU General Public License, Version 2.0, the GNU Lesser 75 | General Public License, Version 2.1, the GNU Affero General Public 76 | License, Version 3.0, or any later versions of those licenses. 77 | 78 | 1.13. “Source Code Form” 79 | 80 | means the form of the work preferred for making modifications. 81 | 82 | 1.14. “You” (or “Your”) 83 | 84 | means an individual or a legal entity exercising rights under this 85 | License. For legal entities, “You” includes any entity that controls, is 86 | controlled by, or is under common control with You. For purposes of this 87 | definition, “control” means (a) the power, direct or indirect, to cause 88 | the direction or management of such entity, whether by contract or 89 | otherwise, or (b) ownership of more than fifty percent (50%) of the 90 | outstanding shares or beneficial ownership of such entity. 91 | 92 | 93 | 2. License Grants and Conditions 94 | 95 | 2.1. Grants 96 | 97 | Each Contributor hereby grants You a world-wide, royalty-free, 98 | non-exclusive license: 99 | 100 | a. under intellectual property rights (other than patent or trademark) 101 | Licensable by such Contributor to use, reproduce, make available, 102 | modify, display, perform, distribute, and otherwise exploit its 103 | Contributions, either on an unmodified basis, with Modifications, or as 104 | part of a Larger Work; and 105 | 106 | b. under Patent Claims of such Contributor to make, use, sell, offer for 107 | sale, have made, import, and otherwise transfer either its Contributions 108 | or its Contributor Version. 109 | 110 | 2.2. Effective Date 111 | 112 | The licenses granted in Section 2.1 with respect to any Contribution become 113 | effective for each Contribution on the date the Contributor first distributes 114 | such Contribution. 115 | 116 | 2.3. Limitations on Grant Scope 117 | 118 | The licenses granted in this Section 2 are the only rights granted under this 119 | License. No additional rights or licenses will be implied from the distribution 120 | or licensing of Covered Software under this License. Notwithstanding Section 121 | 2.1(b) above, no patent license is granted by a Contributor: 122 | 123 | a. for any code that a Contributor has removed from Covered Software; or 124 | 125 | b. for infringements caused by: (i) Your and any other third party’s 126 | modifications of Covered Software, or (ii) the combination of its 127 | Contributions with other software (except as part of its Contributor 128 | Version); or 129 | 130 | c. under Patent Claims infringed by Covered Software in the absence of its 131 | Contributions. 132 | 133 | This License does not grant any rights in the trademarks, service marks, or 134 | logos of any Contributor (except as may be necessary to comply with the 135 | notice requirements in Section 3.4). 136 | 137 | 2.4. Subsequent Licenses 138 | 139 | No Contributor makes additional grants as a result of Your choice to 140 | distribute the Covered Software under a subsequent version of this License 141 | (see Section 10.2) or under the terms of a Secondary License (if permitted 142 | under the terms of Section 3.3). 143 | 144 | 2.5. Representation 145 | 146 | Each Contributor represents that the Contributor believes its Contributions 147 | are its original creation(s) or it has sufficient rights to grant the 148 | rights to its Contributions conveyed by this License. 149 | 150 | 2.6. Fair Use 151 | 152 | This License is not intended to limit any rights You have under applicable 153 | copyright doctrines of fair use, fair dealing, or other equivalents. 154 | 155 | 2.7. Conditions 156 | 157 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in 158 | Section 2.1. 159 | 160 | 161 | 3. Responsibilities 162 | 163 | 3.1. Distribution of Source Form 164 | 165 | All distribution of Covered Software in Source Code Form, including any 166 | Modifications that You create or to which You contribute, must be under the 167 | terms of this License. You must inform recipients that the Source Code Form 168 | of the Covered Software is governed by the terms of this License, and how 169 | they can obtain a copy of this License. You may not attempt to alter or 170 | restrict the recipients’ rights in the Source Code Form. 171 | 172 | 3.2. Distribution of Executable Form 173 | 174 | If You distribute Covered Software in Executable Form then: 175 | 176 | a. such Covered Software must also be made available in Source Code Form, 177 | as described in Section 3.1, and You must inform recipients of the 178 | Executable Form how they can obtain a copy of such Source Code Form by 179 | reasonable means in a timely manner, at a charge no more than the cost 180 | of distribution to the recipient; and 181 | 182 | b. You may distribute such Executable Form under the terms of this License, 183 | or sublicense it under different terms, provided that the license for 184 | the Executable Form does not attempt to limit or alter the recipients’ 185 | rights in the Source Code Form under this License. 186 | 187 | 3.3. Distribution of a Larger Work 188 | 189 | You may create and distribute a Larger Work under terms of Your choice, 190 | provided that You also comply with the requirements of this License for the 191 | Covered Software. If the Larger Work is a combination of Covered Software 192 | with a work governed by one or more Secondary Licenses, and the Covered 193 | Software is not Incompatible With Secondary Licenses, this License permits 194 | You to additionally distribute such Covered Software under the terms of 195 | such Secondary License(s), so that the recipient of the Larger Work may, at 196 | their option, further distribute the Covered Software under the terms of 197 | either this License or such Secondary License(s). 198 | 199 | 3.4. Notices 200 | 201 | You may not remove or alter the substance of any license notices (including 202 | copyright notices, patent notices, disclaimers of warranty, or limitations 203 | of liability) contained within the Source Code Form of the Covered 204 | Software, except that You may alter any license notices to the extent 205 | required to remedy known factual inaccuracies. 206 | 207 | 3.5. Application of Additional Terms 208 | 209 | You may choose to offer, and to charge a fee for, warranty, support, 210 | indemnity or liability obligations to one or more recipients of Covered 211 | Software. However, You may do so only on Your own behalf, and not on behalf 212 | of any Contributor. You must make it absolutely clear that any such 213 | warranty, support, indemnity, or liability obligation is offered by You 214 | alone, and You hereby agree to indemnify every Contributor for any 215 | liability incurred by such Contributor as a result of warranty, support, 216 | indemnity or liability terms You offer. You may include additional 217 | disclaimers of warranty and limitations of liability specific to any 218 | jurisdiction. 219 | 220 | 4. Inability to Comply Due to Statute or Regulation 221 | 222 | If it is impossible for You to comply with any of the terms of this License 223 | with respect to some or all of the Covered Software due to statute, judicial 224 | order, or regulation then You must: (a) comply with the terms of this License 225 | to the maximum extent possible; and (b) describe the limitations and the code 226 | they affect. Such description must be placed in a text file included with all 227 | distributions of the Covered Software under this License. Except to the 228 | extent prohibited by statute or regulation, such description must be 229 | sufficiently detailed for a recipient of ordinary skill to be able to 230 | understand it. 231 | 232 | 5. Termination 233 | 234 | 5.1. The rights granted under this License will terminate automatically if You 235 | fail to comply with any of its terms. However, if You become compliant, 236 | then the rights granted under this License from a particular Contributor 237 | are reinstated (a) provisionally, unless and until such Contributor 238 | explicitly and finally terminates Your grants, and (b) on an ongoing basis, 239 | if such Contributor fails to notify You of the non-compliance by some 240 | reasonable means prior to 60 days after You have come back into compliance. 241 | Moreover, Your grants from a particular Contributor are reinstated on an 242 | ongoing basis if such Contributor notifies You of the non-compliance by 243 | some reasonable means, this is the first time You have received notice of 244 | non-compliance with this License from such Contributor, and You become 245 | compliant prior to 30 days after Your receipt of the notice. 246 | 247 | 5.2. If You initiate litigation against any entity by asserting a patent 248 | infringement claim (excluding declaratory judgment actions, counter-claims, 249 | and cross-claims) alleging that a Contributor Version directly or 250 | indirectly infringes any patent, then the rights granted to You by any and 251 | all Contributors for the Covered Software under Section 2.1 of this License 252 | shall terminate. 253 | 254 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user 255 | license agreements (excluding distributors and resellers) which have been 256 | validly granted by You or Your distributors under this License prior to 257 | termination shall survive termination. 258 | 259 | 6. Disclaimer of Warranty 260 | 261 | Covered Software is provided under this License on an “as is” basis, without 262 | warranty of any kind, either expressed, implied, or statutory, including, 263 | without limitation, warranties that the Covered Software is free of defects, 264 | merchantable, fit for a particular purpose or non-infringing. The entire 265 | risk as to the quality and performance of the Covered Software is with You. 266 | Should any Covered Software prove defective in any respect, You (not any 267 | Contributor) assume the cost of any necessary servicing, repair, or 268 | correction. This disclaimer of warranty constitutes an essential part of this 269 | License. No use of any Covered Software is authorized under this License 270 | except under this disclaimer. 271 | 272 | 7. Limitation of Liability 273 | 274 | Under no circumstances and under no legal theory, whether tort (including 275 | negligence), contract, or otherwise, shall any Contributor, or anyone who 276 | distributes Covered Software as permitted above, be liable to You for any 277 | direct, indirect, special, incidental, or consequential damages of any 278 | character including, without limitation, damages for lost profits, loss of 279 | goodwill, work stoppage, computer failure or malfunction, or any and all 280 | other commercial damages or losses, even if such party shall have been 281 | informed of the possibility of such damages. This limitation of liability 282 | shall not apply to liability for death or personal injury resulting from such 283 | party’s negligence to the extent applicable law prohibits such limitation. 284 | Some jurisdictions do not allow the exclusion or limitation of incidental or 285 | consequential damages, so this exclusion and limitation may not apply to You. 286 | 287 | 8. Litigation 288 | 289 | Any litigation relating to this License may be brought only in the courts of 290 | a jurisdiction where the defendant maintains its principal place of business 291 | and such litigation shall be governed by laws of that jurisdiction, without 292 | reference to its conflict-of-law provisions. Nothing in this Section shall 293 | prevent a party’s ability to bring cross-claims or counter-claims. 294 | 295 | 9. Miscellaneous 296 | 297 | This License represents the complete agreement concerning the subject matter 298 | hereof. If any provision of this License is held to be unenforceable, such 299 | provision shall be reformed only to the extent necessary to make it 300 | enforceable. Any law or regulation which provides that the language of a 301 | contract shall be construed against the drafter shall not be used to construe 302 | this License against a Contributor. 303 | 304 | 305 | 10. Versions of the License 306 | 307 | 10.1. New Versions 308 | 309 | Mozilla Foundation is the license steward. Except as provided in Section 310 | 10.3, no one other than the license steward has the right to modify or 311 | publish new versions of this License. Each version will be given a 312 | distinguishing version number. 313 | 314 | 10.2. Effect of New Versions 315 | 316 | You may distribute the Covered Software under the terms of the version of 317 | the License under which You originally received the Covered Software, or 318 | under the terms of any subsequent version published by the license 319 | steward. 320 | 321 | 10.3. Modified Versions 322 | 323 | If you create software not governed by this License, and you want to 324 | create a new license for such software, you may create and use a modified 325 | version of this License if you rename the license and remove any 326 | references to the name of the license steward (except to note that such 327 | modified license differs from this License). 328 | 329 | 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses 330 | If You choose to distribute Source Code Form that is Incompatible With 331 | Secondary Licenses under the terms of this version of the License, the 332 | notice described in Exhibit B of this License must be attached. 333 | 334 | Exhibit A - Source Code Form License Notice 335 | 336 | This Source Code Form is subject to the 337 | terms of the Mozilla Public License, v. 338 | 2.0. If a copy of the MPL was not 339 | distributed with this file, You can 340 | obtain one at 341 | http://mozilla.org/MPL/2.0/. 342 | 343 | If it is not possible or desirable to put the notice in a particular file, then 344 | You may include the notice in a location (such as a LICENSE file in a relevant 345 | directory) where a recipient would be likely to look for such a notice. 346 | 347 | You may add additional accurate notices of copyright ownership. 348 | 349 | Exhibit B - “Incompatible With Secondary Licenses” Notice 350 | 351 | This Source Code Form is “Incompatible 352 | With Secondary Licenses”, as defined by 353 | the Mozilla Public License, v. 2.0. 354 | 355 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ThunderLink - clickable, durable links to specific messages 2 | ====================================================== 3 | 4 | ### THUNDERLINK IS DEAD / LONG LIVE THUNDERLINK 5 | 6 | Hey people! In case you hadn't noticed, thunderlink doesn't work so well on modern Thunderbird versions. The underlying APIs we used to make thunderlinks work no longer exist. This beloved module needed a complete re-think and re-write. 7 | 8 | Guess what! The rewrite exists now! Head to https://github.com/CamielBouchier/cb_thunderlink and get yourself some modern thunderlinking going 9 | 10 | 11 | ### Old Thunderlink README follows 12 | 13 | 14 | ThunderLinks are durable hyperlinks to specific email messages. 15 | 16 | Make a reference to the ThunderLink anywhere you want immediate access to the original message contents in full. For example, wikis, task trackers, etc. 17 | 18 | Click on a ThunderLink later to open that specific message in Thunderbird. 19 | 20 | You may customize ThunderLink formats to fit your needs. 21 | 22 | You may even configure ThunderLink to tag the email while creating the link, enabling advanced workflows and more productivity! 23 | 24 | ThunderLinks are durable even if you file the message. They are based on the unique message ID generated when an email is sent. This enables the Thunderbird email client to quickly and reliably find and select any email that exists in your Thunderbird mail store. 25 | 26 | Installation 27 | =========== 28 |
    29 |
  1. Install the ThunderLink Add-On in Thunderbird - https://addons.thunderbird.net/en-US/thunderbird/addon/thunderlink/?src=search
  2. 30 |
  3. Register the 'thunderlink' protocol in your OS following the instructions below:
  4. 31 |
32 | 33 | 34 | Windows: 35 | ---------------- 36 | Download the "raw" version of the file that matches your Windows and Thunderbird versions, then double-click the file and confirm the registry script to merge it in to your registry: 37 | 38 | 43 | 44 | These .reg files were generously provided by @mobileartur - please feel free to provide others or open pull requests to help other windows users. Note that 32bit Thunderbird is the current recommendation for Windows. For this reason we don't have registry files for 64-bit Thunderbird. 45 | 46 | Linux (Tested on Ubuntu 18.04LTS): 47 | ---------------------------------- 48 | 49 | 1. Get an example Thunderlink and test it directly. 50 | 51 | Right-click an email and choose "ThunderLink..." > "thunderlink". This will save it to the clipboard. It should look something like this: 52 | 53 | thunderlink://messageid=123456.789012@example.com 54 | 55 | Next, test the thunderlink URL directly from the command line like this: 56 | 57 | $ thunderbird -thunderlink 'thunderlink://messageid=123456.789012@example.com' 58 | 59 | If nothing happens, the addon is either not installed or not functioning. If the message ID is wrong, this will result in an error pop-up that says "Couldn't find an email message for ThunderLink". If it works, it will open the corresponding message. Proceed to the next step to start registering the `thunderlink://` URL scheme. 60 | 61 | 2. Check if the `thunderlink://` protocol is already registered: 62 | 63 | $ gio mime x-scheme-handler/thunderlink 64 | No default applications for “x-scheme-handler/thunderlink” 65 | 66 | If you don't have `gio`, use `xdg-mime` instead: 67 | 68 | $ xdg-mime query default x-scheme-handler/thunderlink 69 | $ echo $? 70 | 4 71 | 72 | Blank output and a non-zero error code from `xdg-mime` mean it's not registered. 73 | 74 | 3. Install the desktop file. 75 | 76 | - Manually: 77 | - Download the thunderlink launcher from 78 | - Copy it to `~/.local/share/applications/thunderbird-tl.desktop` 79 | 80 | - Command line: 81 | - `wget -P ~/.local/share/applications/ https://raw.githubusercontent.com/mikehardy/thunderlink/master/integration/thunderbird-tl.desktop` 82 | 83 | These are the important lines in the desktop file: 84 | 85 | Exec=thunderbird -thunderlink %u 86 | MimeType=x-scheme-handler/thunderlink 87 | 88 | 4. Make the desktop file executable. 89 | 90 | $ chmod +x $HOME/.local/share/applications/thunderbird-tl.desktop 91 | 92 | This is necessary [because of security precautions](https://askubuntu.com/questions/419610/permission-of-a-desktop-file) 93 | 94 | 5. Register the `x-scheme-handler/thunderlink` mimetype to the desktop file. 95 | 96 | Using `gio`: 97 | 98 | $ gio mime x-scheme-handler/thunderlink thunderbird-tl.desktop 99 | Set thunderbird-tl.desktop as the default for x-scheme-handler/thunderlink 100 | 101 | Using `xdg-mime`: 102 | 103 | $ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime default 'thunderbird-tl.desktop' 'x-scheme-handler/thunderlink' 104 | 105 | On most Linux distributions, these commands add this line: 106 | 107 | x-scheme-handler/thunderlink=thunderbird-tl.desktop 108 | 109 | to the configuration file `~/.config/mimeapps.list` under the `[Added Associations]` section. 110 | 111 | 6. Check if it was successfully registered: 112 | 113 | $ gio mime x-scheme-handler/thunderlink 114 | Default application for “x-scheme-handler/thunderlink”: thunderbird-tl.desktop 115 | Registered applications: 116 | thunderbird-tl.desktop 117 | Recommended applications: 118 | thunderbird-tl.desktop 119 | 120 | If you don't have `gio`, use `xdg-mime` instead: 121 | 122 | $ xdg-mime query default x-scheme-handler/thunderlink 123 | thunderbird-tl.desktop 124 | $ echo $? 125 | 0 126 | 127 | 7. Try opening a thunderlink directly with Thunderbird again: 128 | 129 | $ thunderbird -thunderlink 'thunderlink://messageid=123456.789012@example.com' 130 | 131 | and then with `xdg-open` to test the desktop file: 132 | 133 | $ xdg-open 'thunderlink://messageid=123456.789012@example.com' 134 | 135 | If the `xdg-open` command succeeds, then Thunderlink is installed properly. 136 | 137 | 8. If `xdg-open` works but some applications do not, they may be using older configuration files. 138 | 139 | For example, some applications use the old location for `mimeapps.list` instead of 140 | `~/.config/`. To fix this, edit this file with a text editor: 141 | 142 | $ edit ~/.local/share/applications/mimeapps.list 143 | 144 | and manually add this line: 145 | 146 | x-scheme-handler/thunderlink=thunderbird-tl.desktop 147 | 148 | under the "\[Default Applications\]" group. (This location is listed as "[for compatibility, deprecated](https://standards.freedesktop.org/mime-apps-spec/1.0.1/ar01s02.html)" by the FreeDesktop standard.) 149 | 150 | Some applications read `mimeinfo.cache` instead of `mimeapps.list`, so regenerate the cache with `update-desktop-database`. 151 | 152 | $ update-desktop-database ~/.local/share/applications 153 | 154 | Note that this will not read the file at `~/.config/mimeapps.list`, it will read the file at `~/.local/share/applications/mimeapps.list`. 155 | 156 | There is also an [even older deprecated file](https://lists.freedesktop.org/archives/xdg/2014-February/013177.html) called `defaults.list` that is still used by some applications. Handle this in the same way; edit this file with a text editor: 157 | 158 | $ edit ~/.local/share/applications/defaults.list 159 | 160 | and manually add this line: 161 | 162 | x-scheme-handler/thunderlink=thunderbird-tl.desktop 163 | 164 | under the "\[Default Applications\]" group. 165 | 166 | Mac: 167 | ---------- 168 | You may integrate directly with thunderbird using helper scripts as described here: 169 | https://github.com/mikehardy/thunderlink/blob/master/integration/macosx/install.txt 170 | 171 | Separately, it is possible to interoperate with Mail.app on macOS and Thunderbird on (for example) Windows with the same links, following these instructions: https://github.com/mikehardy/thunderlink/wiki/macOS-compatibility---interoperability 172 | 173 | Usage 174 | ------------- 175 | Use the keyboard shortcut for the ThunderLink format you want (e.g. Ctrl-Alt-6) or right-click on an email and select 'ThunderLink...' and the format you want. You now have the ThunderLink to your email in your clipboard. You can paste it into your personal wiki, or your project teams wiki, or a new task entry in your task tracker for instance. 176 | 177 | If you would like a clickable ThunderLink with the email's subject, use a pattern like this: `` - this may be pasted into other systems that render HTML. 178 | 179 | If you registered the ThunderLink protocol correctly, a click on the ThunderLink will open your email directly using the ThunderLink options you configured (open in a new tab, open in a new window, etc) 180 | 181 | 182 | Notes: 183 | ======= 184 | 193 | 194 | Having trouble? 195 | ================ 196 | In the unlikely event of a bug, please open an issue on the provided github link, taking care to include all the requested information. 197 | 198 | Care to contribute? https://github.com/mikehardy/thunderlink 199 | 200 | For devs cloning the repo use make 'makeXpi.sh ' to create distributables for Thunderbird 201 | -------------------------------------------------------------------------------- /chrome.manifest: -------------------------------------------------------------------------------- 1 | content thunderlink chrome/thunderlink/content/ 2 | resource thunderlinkModules modules/ 3 | 4 | overlay chrome://messenger/content/messenger.xul chrome://thunderlink/content/thunderlink-overlay.xul 5 | 6 | component {547bfe26-688b-4e63-a1da-07da0e8367e1} components/thunderlinkCommandLineHandler.js 7 | contract @mozilla.org/commandlinehandler/general-startup;1?type=thunderlink {547bfe26-688b-4e63-a1da-07da0e8367e1} 8 | category command-line-handler ThunderLink @mozilla.org/commandlinehandler/general-startup;1?type=thunderlink 9 | -------------------------------------------------------------------------------- /chrome/thunderlink/content/preferences.js: -------------------------------------------------------------------------------- 1 | /* 2 | ThunderLink. 3 | Link from your browser to your email messages! 4 | 5 | Copyright (C) 2011 Christoph Zwirello 6 | 7 | This Source Code Form is subject to the terms of the Mozilla Public 8 | License, v. 2.0. If a copy of the MPL was not distributed with this 9 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | */ 11 | 12 | var ThunderLinkPrefNS = { 13 | 14 | prefs: null, 15 | 16 | CreateCustomStringTabbox: function CreateCustomStringTabbox() { 17 | var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; 18 | Components.utils.import("resource:///modules/mailServices.js"); 19 | 20 | this.startup(); 21 | 22 | function createCstrTabPanel(cstrnum) { 23 | var tabpanel = window.document.createElementNS(XUL_NS, "tabpanel"); 24 | var vbox = window.document.createElementNS(XUL_NS, "vbox"); 25 | vbox.setAttribute("align", "left"); 26 | tabpanel.appendChild(vbox); 27 | 28 | var tTextbox = window.document.createElementNS(XUL_NS, "textbox"); 29 | tTextbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-title"); 30 | tTextbox.setAttribute("preference", "prefs_customTlString" + cstrnum + "title"); 31 | tTextbox.setAttribute("size", 51); 32 | tTextbox.setAttribute("value", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-title", "string")); 33 | var tLabel = window.document.createElementNS(XUL_NS, "label"); 34 | tLabel.setAttribute("label", "Custom String title:"); 35 | tLabel.setAttribute("control", tTextbox.id); 36 | vbox.appendChild(tLabel); 37 | vbox.appendChild(tTextbox); 38 | 39 | var csTextbox = window.document.createElementNS(XUL_NS, "textbox"); 40 | csTextbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-textbox"); 41 | csTextbox.setAttribute("preference", "prefs_customTlString" + cstrnum); 42 | csTextbox.setAttribute("multiline", "true"); 43 | csTextbox.setAttribute("cols", "50"); 44 | csTextbox.setAttribute("rows", "2"); 45 | csTextbox.setAttribute("value", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum, "string")); 46 | var csLabel = window.document.createElementNS(XUL_NS, "label"); 47 | csLabel.setAttribute("label", "Custom String:"); 48 | csLabel.setAttribute("control", csTextbox.id); 49 | vbox.appendChild(csLabel); 50 | vbox.appendChild(csTextbox); 51 | 52 | // Selection delimiter 53 | var selectionDelimterBox = window.document.createElementNS(XUL_NS, "hbox"); 54 | 55 | var selectionDelimiterTextbox = window.document.createElementNS(XUL_NS, "textbox"); 56 | selectionDelimiterTextbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-selection-delimiter"); 57 | selectionDelimiterTextbox.setAttribute("preference", "prefs_customTlString" + cstrnum + "selectiondelimiter"); 58 | selectionDelimiterTextbox.setAttribute("size", 10); 59 | selectionDelimiterTextbox.setAttribute("value", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-selection-delimiter", "string")); 60 | 61 | var selectionDelimiterLabel = window.document.createElementNS(XUL_NS, "label"); 62 | selectionDelimiterLabel.setAttribute("value", "Multi-select delimiter:"); 63 | selectionDelimiterLabel.setAttribute("control", selectionDelimiterTextbox.id); 64 | 65 | selectionDelimterBox.appendChild(selectionDelimiterLabel); 66 | selectionDelimterBox.appendChild(selectionDelimiterTextbox); 67 | vbox.appendChild(selectionDelimterBox); 68 | 69 | // Clipboard checkbox 70 | var clipboardCheckbox = window.document.createElementNS(XUL_NS, "checkbox"); 71 | clipboardCheckbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-clipboard-checkbox"); 72 | clipboardCheckbox.setAttribute("checked", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-clipboard-checkbox", "bool")); 73 | clipboardCheckbox.setAttribute("preference", "prefs_customTlString" + cstrnum + "clipboardcheckbox"); 74 | clipboardCheckbox.setAttribute("label", "Copy ThunderLink to clipboard"); 75 | vbox.appendChild(clipboardCheckbox); 76 | 77 | var tagCheckbox = window.document.createElementNS(XUL_NS, "checkbox"); 78 | tagCheckbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-tagcheckbox"); 79 | tagCheckbox.setAttribute("checked", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-tagcheckbox", "bool")); 80 | tagCheckbox.setAttribute("preference", "prefs_customTlString" + cstrnum + "tagcheckbox"); 81 | tagCheckbox.setAttribute("label", "Tag email upon copying the ThunderLink:"); 82 | tagCheckbox.addEventListener("command", () => { ThunderLinkPrefNS.ToggleTlTagField(cstrnum); }, false); 83 | vbox.appendChild(tagCheckbox); 84 | 85 | var tagLabel = window.document.createElementNS(XUL_NS, "label"); 86 | tagLabel.setAttribute("control", "thunderlink-prefCustomTlString" + cstrnum + "-tag"); 87 | tagLabel.setAttribute("value", "using tag:"); 88 | 89 | function appendMenuItems(menuPopup) { 90 | var tagArray = MailServices.tags.getAllTags({}); 91 | var selectedIndex = ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-tag", "int"); 92 | for (let j = 0; j < tagArray.length; ++j) { 93 | var menuItem = window.document.createElementNS(XUL_NS, "menuitem"); 94 | 95 | menuItem.setAttribute("label", tagArray[j].tag); 96 | menuItem.setAttribute("value", j + 1); 97 | if (selectedIndex === (j + 1) && ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-tagcheckbox", "bool")) { 98 | menuItem.setAttribute("selected", true); 99 | } 100 | menuPopup.appendChild(menuItem); 101 | } 102 | } 103 | var menuList = window.document.createElementNS(XUL_NS, "menulist"); 104 | menuList.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-tag"); 105 | var menuPopup = window.document.createElementNS(XUL_NS, "menupopup"); 106 | menuList.setAttribute("preference", "prefs_customTlString" + cstrnum + "tag"); 107 | menuList.setAttribute("disabled", !ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-tagcheckbox", "bool")); 108 | appendMenuItems(menuPopup); 109 | 110 | menuList.appendChild(menuPopup); 111 | 112 | var labelbox = window.document.createElementNS(XUL_NS, "hbox"); 113 | labelbox.appendChild(tagLabel); 114 | labelbox.appendChild(menuList); 115 | vbox.appendChild(labelbox); 116 | 117 | // Append to file checkbox 118 | var appendToFileCheckbox = window.document.createElementNS(XUL_NS, "checkbox"); 119 | appendToFileCheckbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-appendtofile-checkbox"); 120 | appendToFileCheckbox.setAttribute("checked", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-appendtofile-checkbox", "bool")); 121 | appendToFileCheckbox.setAttribute("preference", "prefs_customTlString" + cstrnum + "appendtofilecheckbox"); 122 | appendToFileCheckbox.setAttribute("label", "Append Thunderlink to file:"); 123 | vbox.appendChild(appendToFileCheckbox); 124 | 125 | // Append to file label and path 126 | var fileLabelBox = window.document.createElementNS(XUL_NS, "hbox"); 127 | 128 | var appendToFileTextbox = window.document.createElementNS(XUL_NS, "textbox"); 129 | appendToFileTextbox.setAttribute("id", "thunderlink-prefCustomTlString" + cstrnum + "-appendtofile-path"); 130 | appendToFileTextbox.setAttribute("preference", "prefs_customTlString" + cstrnum + "appendtofilepath"); 131 | appendToFileTextbox.setAttribute("size", 51); 132 | appendToFileTextbox.setAttribute("value", ThunderLinkPrefNS.GetPreferenceValue("custom-tl-string-" + cstrnum + "-appendtofile-path", "string")); 133 | 134 | var appendToFileLabel = window.document.createElementNS(XUL_NS, "label"); 135 | appendToFileLabel.setAttribute("value", "Path to file:"); 136 | // appendToFileLabel.setAttribute("label", "Custom String title:"); 137 | appendToFileLabel.setAttribute("control", appendToFileTextbox.id); 138 | 139 | fileLabelBox.appendChild(appendToFileLabel); 140 | fileLabelBox.appendChild(appendToFileTextbox); 141 | vbox.appendChild(fileLabelBox); 142 | 143 | // shortcut 144 | var keyLabel = window.document.createElementNS(XUL_NS, "label"); 145 | keyLabel.setAttribute("value", "Shortcut: CTRL + ALT + " + cstrnum); 146 | vbox.appendChild(keyLabel); 147 | 148 | return tabpanel; 149 | } 150 | 151 | function createCstrTab(cstrnum) { 152 | var tab = window.document.createElementNS(XUL_NS, "tab"); 153 | tab.setAttribute("label", "String " + cstrnum); 154 | return tab; 155 | } 156 | 157 | var tabbox = window.document.getElementById("thunderlink-custom-strings-tabbox"); 158 | if (tabbox.hasChildNodes()) { 159 | while (tabbox.firstChild) { 160 | tabbox.removeChild(tabbox.firstChild); 161 | } 162 | } 163 | 164 | var tabs = window.document.createElementNS(XUL_NS, "tabs"); 165 | var tabpanels = window.document.createElementNS(XUL_NS, "tabpanels"); 166 | 167 | var nrOfCStrings = 8; 168 | for (let i = 1; i <= nrOfCStrings; i++) { 169 | tabs.appendChild(createCstrTab(i)); 170 | tabpanels.appendChild(createCstrTabPanel(i)); 171 | } 172 | tabbox.appendChild(tabs); 173 | tabbox.appendChild(tabpanels); 174 | }, 175 | 176 | ToggleTlTagField: function ToggleTlTagField(cstrnum) { 177 | function $(aID) { return document.getElementById(aID); } 178 | var tlTagCheckbox = $("thunderlink-prefCustomTlString" + cstrnum + "-tagcheckbox"); 179 | var tlTagField = $("thunderlink-prefCustomTlString" + cstrnum + "-tag"); 180 | if (tlTagCheckbox.checked) { 181 | tlTagField.disabled = false; 182 | } else { 183 | tlTagField.disabled = true; 184 | } 185 | console.log("toggling tag field " + cstrnum + " to " + tlTagCheckbox.checked); 186 | }, 187 | 188 | startup: function startup() { 189 | this.prefs = Components.classes["@mozilla.org/preferences-service;1"] 190 | .getService(Components.interfaces.nsIPrefService) 191 | .getBranch("extensions.thunderlink."); 192 | }, 193 | 194 | GetPreferenceValue: function GetPreferenceValue(prefname, type) { 195 | // var prefService = Components.classes["@mozilla.org/preferences-service;1"] 196 | // .getService(Components.interfaces.nsIPrefService) 197 | // .getBranch("extensions.thunderlink."); 198 | // prefService.QueryInterface(Components.interfaces.nsIPrefBranch); 199 | 200 | console.log("Looking for pref " + prefname + " / what type? " + type); 201 | var prefValue = ""; 202 | switch (type) { 203 | case "bool": 204 | prefValue = this.prefs.getBoolPref(prefname); 205 | break; 206 | case "int": 207 | prefValue = this.prefs.getIntPref(prefname); 208 | break; 209 | default: 210 | prefValue = this.prefs.getCharPref(prefname); 211 | break; 212 | } 213 | console.log("pref " + prefname + " is " + prefValue); 214 | return prefValue; 215 | }, 216 | 217 | LOG: function LOG(msg) { 218 | var consoleService = Components.classes["@mozilla.org/consoleservice;1"] 219 | .getService(Components.interfaces.nsIConsoleService); 220 | consoleService.logStringMessage(msg); 221 | }, 222 | 223 | onUnload: function onUnload(prefwindow) { 224 | console.log("unloading preferences window " + prefwindow + " / " + prefwindow.id); 225 | 226 | if (this.prefs.getPrefType('open-tl-behaviour')) { 227 | console.log("key exists: " + this.prefs.getCharPref('open-tl-behaviour')); 228 | if (this.prefs.prefHasUserValue('open-tl-behaviour')) { 229 | console.log("key has user-specific value"); 230 | } 231 | 232 | var openTlBehaviourElement = prefwindow.getElementById("thunderlink-openTlBehaviour"); 233 | console.log("tl behavior value is: " + openTlBehaviourElement.value); 234 | this.prefs.setCharPref("open-tl-behaviour", openTlBehaviourElement.value); 235 | } 236 | 237 | for (var cstrnum = 1; cstrnum <= 8; cstrnum++) { 238 | // Save the title 239 | var titleElement = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-title"); 240 | console.log("setting title " + cstrnum + " to " + titleElement.value); 241 | this.prefs.setCharPref("custom-tl-string-" + cstrnum + "-title", titleElement.value); 242 | 243 | // Save the content 244 | var linkElement = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-textbox"); 245 | console.log("setting link " + cstrnum + " to " + linkElement.value); 246 | this.prefs.setCharPref("custom-tl-string-" + cstrnum, linkElement.value); 247 | 248 | // Selection delimiter 249 | var selectionDelimiterElement = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-selection-delimiter"); 250 | console.log("setting selection delimiter " + cstrnum + " to " + selectionDelimiterElement.value); 251 | this.prefs.setCharPref("custom-tl-string-" + cstrnum + "-selection-delimiter", selectionDelimiterElement.value); 252 | 253 | // Save whether we should copy thunderlink to clipboard 254 | var clipboardEnabledEl = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-clipboard-checkbox"); 255 | console.log("We should copy thunderlink for " + cstrnum + "? " + clipboardEnabledEl.checked); 256 | this.prefs.setBoolPref("custom-tl-string-" + cstrnum + "-clipboard-checkbox", clipboardEnabledEl.checked); 257 | 258 | // Save whether we should tag or not 259 | var tagEnabledEl = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-tagcheckbox"); 260 | console.log("We should tag email for " + cstrnum + "? " + tagEnabledEl.checked); 261 | this.prefs.setBoolPref("custom-tl-string-" + cstrnum + "-tagcheckbox", tagEnabledEl.checked); 262 | 263 | // Save the tag 264 | var tagElement = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-tag"); 265 | console.log("We should tag " + cstrnum + " with " + tagElement.value); 266 | this.prefs.setIntPref("custom-tl-string-" + cstrnum + "-tag", tagElement.value); 267 | 268 | // Save whether we should append thunderlink to file 269 | var appendEnabledEl = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-appendtofile-checkbox"); 270 | console.log("We should append thunderlink for " + cstrnum + "? " + appendEnabledEl.checked); 271 | this.prefs.setBoolPref("custom-tl-string-" + cstrnum + "-appendtofile-checkbox", appendEnabledEl.checked); 272 | 273 | // Append path 274 | var pathElement = prefwindow.getElementById("thunderlink-prefCustomTlString" + cstrnum + "-appendtofile-path"); 275 | console.log("Setting append path " + cstrnum + " to " + pathElement.value); 276 | this.prefs.setCharPref("custom-tl-string-" + cstrnum + "-appendtofile-path", pathElement.value); 277 | 278 | if (appendEnabledEl.checked && pathElement.value === "") { 279 | var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] 280 | .getService(Components.interfaces.nsIPromptService); 281 | prompts.alert(null, "Thunderlink Error", "In String " + cstrnum + " you have checked append thunderlink to file, but the path is empty.\nThunderlink will uncheck it!!!!"); 282 | this.prefs.setBoolPref("custom-tl-string-" + cstrnum + "-appendtofile-checkbox", false); 283 | } 284 | } 285 | 286 | var prefService = Components.classes["@mozilla.org/preferences-service;1"] 287 | .getService(Components.interfaces.nsIPrefService); 288 | prefService.savePrefFile(null); 289 | return true; 290 | }, 291 | 292 | escapeHtml: function escapeHtml(unsafe) { 293 | console.log(`attempting to escape ${unsafe}`); 294 | return unsafe 295 | .replace(/&/g, "&") 296 | .replace(//g, ">") 298 | .replace(/"/g, """) 299 | .replace(/'/g, "'"); 300 | }, 301 | 302 | }; 303 | -------------------------------------------------------------------------------- /chrome/thunderlink/content/preferences.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 105 | 106 | 124 | 125 | 126 | 127 |