I just started with a new chrome extension however I couldn't find how to get the exact caret (text cursor) position in JavaScript
code
chrome.commands.onCommand.addListener(function (command) {
console.log('Command:', command);
if (command == "OpenRightclick-menu") {
// Get coordinates
}
});
You can get access to current cursor position from your content script.
If you have an DOM node of element, you can check selectionStart and selectionEnd properties.
If you don't have DOM node - you can check answer on this question.