Skip to content

Commit

Permalink
Merge pull request #12 from WesleyBranton/Version-2.1
Browse files Browse the repository at this point in the history
Version 2.1
  • Loading branch information
WesleyBranton committed Jun 5, 2019
2 parents 7f06faa + c4c449a commit 2a788bd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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.1
* **[FIXED]** Restored compatibility on Firefox for Android

### Version 2.0
* **[NEW]** Updated encryption algorithm for better security
* **[NEW]** Can now share messages via links
Expand Down
26 changes: 22 additions & 4 deletions firefox/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@

browser.browserAction.onClicked.addListener(function(){open("/popup/main.html")});
browser.webRequest.onBeforeRequest.addListener(getMessage,{urls: ["*://*.securesend.local/*","*://securesend.local/*"]},["blocking"]);
var isAndroid;
detectOS();

// Open window
function open(page) {
browser.windows.create({
type:"popup",
url:page
});
if (!isAndroid) {
browser.windows.create({
type:"popup",
url:page
});
} else {
browser.tabs.create({
url:page
});
}
}

// Load message URL
Expand All @@ -22,3 +30,13 @@ function getMessage(requestDetails) {
}
return {cancel: true};
}

// Detect user operating system
async function detectOS() {
var userOS = await browser.runtime.getPlatformInfo();
if (userOS.os == 'android') {
isAndroid = true;
} else {
isAndroid = false;
}
}
4 changes: 2 additions & 2 deletions firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Secure Send",
"version": "2.0",
"version": "2.1",
"description": "Secure your messages using encryption!",
"author": "Wesley Branton",

Expand All @@ -27,5 +27,5 @@
"scripts": ["background.js"]
},

"permissions": ["storage","webRequest","webRequestBlocking","*://*.securesend.local/*","*://securesend.local/*"]
"permissions": ["storage","tabs","webRequest","webRequestBlocking","*://*.securesend.local/*","*://securesend.local/*"]
}

0 comments on commit 2a788bd

Please sign in to comment.