Chrome拡張で、選択した範囲の文字列を取得したいのですが、改行を半角スペースに変えられてしまいます。
そうすればいいでしょうか?
chrome.contextMenus.create({ "title" : "A", "type" : "normal", "contexts" : ["selection"], "onclick" : TextSearch() }); function TextSearch() { return function(info, tab) { var str = info.selectionText;//Chromeのinfo.selectionTextは改行がスペースに変換される。 }; };