From 8d0cf41d73f1a85bd5fdb934a5e7808e08d80a55 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Thu, 23 Aug 2018 09:49:40 +0300 Subject: [PATCH] Add test sever --- manifest.json | 3 ++- postify.js | 12 ++++++++++++ server.php | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 server.php diff --git a/manifest.json b/manifest.json index d7f2102..2f0a845 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,8 @@ "permissions": [ "activeTab", "notifications", - "tabs" + "tabs", + "" ], "background": { "scripts": ["postify.js"] diff --git a/postify.js b/postify.js index 69168d1..49208fd 100644 --- a/postify.js +++ b/postify.js @@ -1,4 +1,5 @@ const APP_NAME = 'Postify'; +const SERVER_ADDR = 'http://127.0.0.1:9999'; function sendUrl(url) { browser.notifications.create({ @@ -7,6 +8,17 @@ function sendUrl(url) { "title": APP_NAME, "message": url, }); + + fetch(SERVER_ADDR, { + method: 'POST', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + url: url + }) + }); } function sendCurrentUrl(args) { diff --git a/server.php b/server.php new file mode 100644 index 0000000..e1ec6b6 --- /dev/null +++ b/server.php @@ -0,0 +1,5 @@ +