From fa8316a94c092e986b4b2616f1992ee2a3eec01a Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Fri, 12 Jul 2019 19:59:42 +0530 Subject: Initial Commit :tada: * Adds Manifest for Extension * Adds barebone messaging from extension and front-end * Adds .env to run react app under CSP --- public/content_script.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 public/content_script.js (limited to 'public/content_script.js') diff --git a/public/content_script.js b/public/content_script.js new file mode 100644 index 0000000..612ecf5 --- /dev/null +++ b/public/content_script.js @@ -0,0 +1,27 @@ +(function(){ + + /* Open port on popup file */ + const port = chrome.runtime.connect({ + name: "bookmarkArranger" + }); + + /* Listen for messages on the port */ + port.onMessage.addListener(message => { + console.log(message) + }); + + document.getElementById('sendMessage').addEventListener('click', ()=>{ + /* Send a message through the port */ + port.postMessage({ + code: "getBookMarks" + }); + }) + + + + +})(); + + + + -- cgit v1.2.3