aboutsummaryrefslogtreecommitdiff
path: root/public/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/background.js')
-rw-r--r--public/background.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/public/background.js b/public/background.js
new file mode 100644
index 0000000..f94c039
--- /dev/null
+++ b/public/background.js
@@ -0,0 +1,24 @@
+
+
+chrome.browserAction.onClicked.addListener( (tab) =>{
+ chrome.tabs.create({ 'url': chrome.extension.getURL('index.html') }, (tab) => {
+
+ });
+});
+
+
+chrome.runtime.onConnect.addListener(port => {
+ port.onMessage.addListener(message => {
+ /* Perform an action if the message meets our criteria */
+ if (message.code === "getBookMarks") {
+ getBookMarks(port)
+ }
+ })
+});
+
+getBookMarks = (port) => {
+ chrome.bookmarks.getTree(function (data) {
+ port.postMessage({ bookMarkData: data})
+ });
+
+} \ No newline at end of file