The project I am working on requires me to extract a few paragraph of text (ie: from textarea or div tag) from a regular web page and save them to my local drive (preferably Windows). (The paragraphs of text stored on my local drive will then be read by another native program. So storing the paragraphs of text on my local drive within a “sandbox” may not be of much help) .
Is it possible to do that at all?
I have tried learning/using Chrome extension/app, Chrome native messaging and Node.JS. So far, correct me if I am wrong, I see that users can send/save (1) the text from a regular web page to Chrome extension (and not to Chrome app), (2) text from Chrome app (and not from Chrome extension) to local drive and (3) text from either Chrome app or extension to local drive using node.js.
So my plan is to write a Chrome extension and a javascript to run under node.js (ie: hosting locally). The Chrome extension will extract text from the regular web page then sent it to the javascript (running under node.js on the local machine). Upon receiving the text sent from the Chrome extension, the javascript will save the text on to the local drive.
ie: WebPage → Chrome extension → c:\>node c:\abc\myScript.js → localDrive
Is it possible to do that at all? Are there easier/better ways? Can I get away without using node.js (meaning saving directly from Chrome extension/app)? I guess, NaCl may not help, as I understand it sandboxed everything it stored on local drive.
All I need is to be able to store text from a regular web page on to my local drive.
var myText;
var myStrText=JSON.stringify(myText);
saveText("default_name.txt", myStrText);
function saveText(filename, text) {
var tempElem = document.createElement('a');
tempElem.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
tempElem.setAttribute('download', filename);
tempElem.click();
}
chrome.downloads.download({ url: imgSrc, saveAs: false });
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/a13d55bb-a9bd-4b04-93f5-55ac2faff718%40chromium.org.
chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) {
suggest({filename: item.filename,
conflict_action: 'overwrite',
conflictAction: 'overwrite'});
});
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/2ed769df-9c47-4167-8786-f87fa3d7498d%40chromium.org.