Added override message for session edits.

This commit is contained in:
Maxim Stewart 2019-01-19 01:56:20 -06:00
parent 96809cabec
commit eaf366ca33
3 changed files with 15 additions and 5 deletions

View File

@ -4,8 +4,8 @@ Easy Session Manager allows you to manage your Firefox session by backing up or
# Download # Download
https://addons.mozilla.org/en-US/firefox/addon/easy-session-manager/ https://addons.mozilla.org/en-US/firefox/addon/easy-session-manager/
# Version: 0.0.6 # Version: 0.0.7
Improved loading of sessions. Added override message for session edits.
# Images # Images
![1 Default interface with no sessions. ](images/pic1.png) ![1 Default interface with no sessions. ](images/pic1.png)

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": " Easy Session Manager", "name": " Easy Session Manager",
"version": "0.0.6", "version": "0.0.7",
"description": " Easy Session Manager allows you to manage your Firefox session by backing up or loading your saved sessions.", "description": " Easy Session Manager allows you to manage your Firefox session by backing up or loading your saved sessions.",
"applications": { "applications": {

View File

@ -19,6 +19,7 @@ const alertMessage = (type, message) => {
msgTag.style.backgroundColor = bgColor; msgTag.style.backgroundColor = bgColor;
msgTag.style.color = fontColor; msgTag.style.color = fontColor;
msgTag.style.display = "block"; msgTag.style.display = "block";
msgTag.innerHTML = "";
msgTag.append(text); msgTag.append(text);
setTimeout(function () { setTimeout(function () {
@ -65,8 +66,17 @@ const saveSession = () => {
} }
const saveToStorage = (name, data) => { const saveToStorage = (name, data) => {
storage.set({[name]: data}); storage.get(name).then((storageResults) => {
let json = null;
try {
json = JSON.parse(storageResults[name]);
alertMessage("success", "Overwrote session...");
} catch (e) {
alertMessage("success", "Saved session..."); alertMessage("success", "Saved session...");
} finally {
storage.set({[name]: data});
}
});
} }
const importSession = () => { const importSession = () => {