0

I want to read data from an URL and write this values to a local file with javascript and Greasemonkey.

for example: my page :

<script>

function opens()
{
var x=document.getElementById('sval').value;
var y=document.getElementById('eval').value;
for(i=x;i<y;i++)
{
    window.open('https://www.google.com/search?q=javascript');
}
}
</script>
Start<input type='text' id='sval' ></input>
<br>
End<input type='text' id='eval'></input>
<br>
<button onclick='opens()'>a</button>

so: in Greasemonkey I want to get value of search and then write to c:\file.txt

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
ARM
  • 13
  • 5
  • 1
    possible duplicate of [Storing into file using JavaScript/GreaseMonkey](http://stackoverflow.com/questions/6392103/storing-into-file-using-javascript-greasemonkey) – Brock Adams Feb 29 '12 at 11:17
  • Greasemonkey does not allow this. The best you can do is send the data to a server. The server (which you can set up on your own machine, would write the `file.txt`. – Brock Adams Feb 29 '12 at 11:19

1 Answers1

1

You cant write a file to disc, but you do have a few options:

1- store the value in a cookie
2- GM_setValue
3- IndexedDB

RASG
  • 5,988
  • 4
  • 26
  • 47
  • 1
    ok... so, Mr. Downvoter, i presume my answer is incorrect and it IS possible to write a file to disc with javascript? – RASG Apr 09 '12 at 14:34
  • 1
    Downvote may have occurred because your [answer contains only links](http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers/8259#8259). – Cephalopod Jun 23 '14 at 13:03