aboutsummaryrefslogtreecommitdiff
path: root/public/background.js
blob: f94c0399cdb056011ff4131f36d338d48e409238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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})
	});
	
}