Skip to content

Commit

Permalink
Merge pull request #8 from yuki777/dev-server
Browse files Browse the repository at this point in the history
Dev server
  • Loading branch information
yuki777 authored Jun 17, 2022
2 parents 5b2a4f1 + a372acc commit 8c94b08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Peacekeeper",
"version": "1.0.3",
"version": "1.0.4",
"description": "Peacekeeper will notify you for each website you specify.",
"background": {
"service_worker": "background.js"
Expand Down
21 changes: 17 additions & 4 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ const saveObjectInLocalStorage = async function(obj) {

document.getElementById("saveConfigs").addEventListener("click",async function(e){
if(document.getElementById("textareaConfigs").value){
let jsonConfigs = JSON.parse(document.getElementById("textareaConfigs").value);
await saveObjectInLocalStorage({'configs': jsonConfigs});
alert('Configs are saved.');
try{
let jsonConfigs = JSON.parse(document.getElementById("textareaConfigs").value);
await saveObjectInLocalStorage({'configs': jsonConfigs});
alert('Configs are saved.');
}catch(error){
alert(error.message);
}
}
},false);

Expand Down Expand Up @@ -58,6 +62,15 @@ function getDefaultConfigs(){
"toast": false,
"url": "http:\/\/127.0.0.1:(.+83|8080)"
},
{
"alert": false,
"favicon": false,
"style": {
"backgroundColor": "blue"
},
"toast": false,
"url": "https://dev-.+-admin.+"
},
{
"alert": false,
"favicon": {
Expand All @@ -84,7 +97,7 @@ function getDefaultConfigs(){
"toast": {
"position": "center",
"icon": "error",
"title": "Hey, Watch out! It's PRODUCTION!!!",
"title": "It's PRODUCTION!!!",
"showConfirmButton": false,
"timer": 1000
},
Expand Down

0 comments on commit 8c94b08

Please sign in to comment.