Is there another way to get highlighted text(retain line breaks)?
var newProspect = function(string){
console.log(string.selectionText);
};
chrome.contextMenus.create({
title: "New Prospect",
contexts:["all"],
onclick: newProspect
});
Is there another way to get highlighted text(retain line breaks)?
var newProspect = function(string){
console.log(string.selectionText);
};
chrome.contextMenus.create({
title: "New Prospect",
contexts:["all"],
onclick: newProspect
});
var newProspect = function(string){
chrome.tabs.executeScript(
{
code: "window.getSelection().toString(); ",
},
function (selection) {
var selectionText = selection[0]
}
);
};
chrome.contextMenus.create({
title: "New Prospect",
contexts: ["selection"],
onclick: newProspect,
});