Skip to content

Commit

Permalink
Merge pull request #12 from WesleyBranton/development
Browse files Browse the repository at this point in the history
Version 2.2.1
  • Loading branch information
WesleyBranton committed Nov 1, 2019
2 parents d529952 + 9f970fb commit 0605e58
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
Binary file added .github/fxaddon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Outlook.com-mailto
# Outlook.com-mailto [<img align="right" src=".github/fxaddon.png">](https://addons.mozilla.org/firefox/addon/outlook-com-mailto/)
This browser extension will add the option in the Firefox application settings to set the default email provider for mailto links to Outlook.com. Mailto links on websites will automatically open the Outlook.com interface and prefill the information.

**DISCLAIMER:** This browser extension is unofficial and is not affiliated with Microsoft.

**PRODUCT PAGE:** [View Now](https://addons.mozilla.org/firefox/addon/outlook-com-mailto/)

## Development
This repository contains all of the required source code files to make changes to this extension. The "master" branch contains the source code for the latest stable release. If you want to test that version, you can view the release section to download the XPI file or visit the add-on listing on Mozilla.

Expand All @@ -15,6 +13,9 @@ To develop and test the extension, you need to open the "about:debugging" page i
Further documentation about developing Firefox extensions can be found [here](https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension).

## Release Notes
### Version 2.2.1
* **[FIXED]** Links now work when a website uses uppercase URL query fields

### Version 2.2
* **[FIXED]** Opening link in new tab no longer creates additional blank tab
* **[FIXED]** Created tab always appears next to the original tab
Expand Down
26 changes: 25 additions & 1 deletion firefox/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,31 @@ function getParameters(url) {
to = decodedURL;
formatURL = "?to=" + to;
}
return formatURL;
return format(formatURL);
}

// Converts all queries to lowercase
function format(url) {
var output = '';
var urlParts = url.split('&');

for (i = 0; i < urlParts.length; i++) {
// Adds the "&" to all but the first query
if (i > 0) {
output += '&';
}

var end = urlParts[i].indexOf('=');
if (end > 0) {
var field = urlParts[i].substring(0, end);
var value = urlParts[i].substring(end);
output += field.toLowerCase() + value;
} else {
output += urlParts[i];
}
}

return output;
}

// Determines which Outlook service to go to
Expand Down
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Outlook.com mailto",
"version": "2.2",
"version": "2.2.1",
"description": "Add Outlook.com as a default email provider for all mailto links.",
"author": "Wesley Branton",

Expand Down

0 comments on commit 0605e58

Please sign in to comment.