0

I'm trying to implement some extension to inspect elements on the page. The first thought was to add a context menu like "Inspect element" but the information the callback is passing is not enough. Actually it doesn't have any data about the element that is being right clicked. Is it possible at all? May be there are some other way to accomplish it?

The code I'm using is below:

function checkElement(info,tab) {
    // info doesn't have real information about the clicked object

  }
chrome.contextMenus.create({
    title: "Check element", 
    contexts:["all"], 
    onclick: checkElement,
  });

Thanks

mimic
  • 4,897
  • 7
  • 54
  • 93
  • 1
    Check this one out: https://stackoverflow.com/questions/7703697/how-to-retrieve-the-element-where-a-contextmenu-has-been-executed – maxpaj Dec 10 '17 at 08:52
  • 1
    @maxpaj Thanks a lot, looks like it's exactly what I need. – mimic Dec 10 '17 at 21:54

0 Answers0