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 @@ +