0 points

Preserve linebreaks/newlines in selected text in chrome.contextMenus


dashboard

Tue May 19 2020 19:59:28 GMT+0000 (UTC)

Posted by @mishka #javascript

chrome.tabs.executeScript( {
	code: "window.getSelection().toString();"
}, function(selection) {
	// selected contains text including line breaks
	var selected = selection[0];
});
content_copy Copy

https://bugs.chromium.org/p/chromium/issues/detail?id=116429