diff --git a/src/scripts/background.js b/src/scripts/background.js index 42bb624..8aa4aeb 100644 --- a/src/scripts/background.js +++ b/src/scripts/background.js @@ -4,7 +4,7 @@ import storage from "./utils/storage"; ext.runtime.onMessage.addListener( function(request, sender, sendResponse) { if(request.action === "perform-save") { - var data = JSON.parse(request.data); + var data = request.data; var url; var token; storage.get(['url', 'token'], function(resp) { diff --git a/src/scripts/contentscript.js b/src/scripts/contentscript.js index 39ec860..88f0fbc 100644 --- a/src/scripts/contentscript.js +++ b/src/scripts/contentscript.js @@ -8,7 +8,7 @@ var extractTags = () => { title: "", description: "", url: document.location.href - } + }; var ogTitle = document.querySelector("meta[property='og:title']"); if(ogTitle) { @@ -23,7 +23,7 @@ var extractTags = () => { } return data; -} +}; function onRequest(request, sender, sendResponse) { if (request.action === 'process-page') { diff --git a/src/scripts/popup.js b/src/scripts/popup.js index 0b2c010..6958ad9 100644 --- a/src/scripts/popup.js +++ b/src/scripts/popup.js @@ -1,6 +1,12 @@ import ext from "./utils/ext"; import storage from "./utils/storage"; +var page_data = { + title: "", + description: "", + url: document.location.href +}; + var popup = document.getElementById("app"); storage.get('color', function(resp) { var color = resp.color; @@ -10,7 +16,6 @@ storage.get('color', function(resp) { }); var template = (data) => { - var json = JSON.stringify(data); return (`