Initial Commit
🎉
* Adds Manifest for Extension
* Adds barebone messaging from extension and front-end
* Adds .env to run react app under CSP
This commit is contained in:
27
public/content_script.js
Normal file
27
public/content_script.js
Normal file
@@ -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"
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user