Last active
June 24, 2020 12:27
-
-
Save alejandrocoding/c22cf6329e3eefc799c195c51d5f610e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { | |
if (request.myBookMark) { | |
chrome.bookmarks.create( | |
{ | |
parentId: '1', | |
title: 'BookMark!', | |
url: 'https://google.es/' | |
}, | |
() => sendResponse('I have added my first bookmark!') // This is the response back for the emitter of the message in contentScript.ts | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment