aboutsummaryrefslogtreecommitdiff
path: root/public/content_script.js
blob: 612ecf5a8d37f341bc23dbb87d226dde4b821937 (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
25
26
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"
        });
    })
    



})();