Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. chrome.contextMenus.onClicked.addListener(function(clickData){
  2. if(clickData.menuItemId === "trackIT" && clickData.selectionText){
  3. // Send the parsed data to the labview listening server
  4. console.log(clickData.selectionText);
  5. chrome.runtime.sendMessage({
  6. msg : "task_trackIT",
  7. data : {
  8. "taskName" : clickData.selectionText
  9. }
  10. })
  11. } else {
  12. console.log("do nothing");
  13. }
  14.  
  15. });
  16.  
  17. chrome.runtime.onMessage.addListener(
  18. function(request, sender, sendResponse){
  19. if(request.msg === "task_trackIT"){
  20. console.log(request.data.taskName);
  21. // httpService.postMessage()
  22. // xhr.send("1234")
  23. self.postMessage({"Notes":request.data.taskName})
  24. }
  25. }
  26. )
Add Comment
Please, Sign In to add comment