Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chrome.contextMenus.onClicked.addListener(function(clickData){
- if(clickData.menuItemId === "trackIT" && clickData.selectionText){
- // Send the parsed data to the labview listening server
- console.log(clickData.selectionText);
- chrome.runtime.sendMessage({
- msg : "task_trackIT",
- data : {
- "taskName" : clickData.selectionText
- }
- })
- } else {
- console.log("do nothing");
- }
- });
- chrome.runtime.onMessage.addListener(
- function(request, sender, sendResponse){
- if(request.msg === "task_trackIT"){
- console.log(request.data.taskName);
- // httpService.postMessage()
- // xhr.send("1234")
- self.postMessage({"Notes":request.data.taskName})
- }
- }
- )
Add Comment
Please, Sign In to add comment