Discussion:
Can greasemonkey/javascript read a .txt file?
R***@gmail.com
2007-09-13 06:07:47 UTC
Permalink
Can greasemonkey/javascript read a .txt file? If so how?

Like I need it to read the first line of a .txt file and store
whatever is on the first line into a greasemonkey variable, which I
can later address.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-***@googlegroups.com
To unsubscribe from this group, send email to greasemonkey-users-***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Dan Phiffer
2007-09-13 13:13:01 UTC
Permalink
Post by R***@gmail.com
Can greasemonkey/javascript read a .txt file? If so how?
That depends, is the text file on a server somewhere? If so, you can
use GM_xmlhttpRequest.
Post by R***@gmail.com
Like I need it to read the first line of a .txt file and store
whatever is on the first line into a greasemonkey variable, which I
can later address.
To store data for later you can use GM_setValue and GM_getValue.

Search for the documentation on those to get started.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-***@googlegroups.com
To unsubscribe from this group, send email to greasemonkey-users-***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---
R***@gmail.com
2007-09-14 04:06:00 UTC
Permalink
Actually, its a text file on my own computer and has nothing to do
with the website. I dunno if theres something that can be done.
Post by Dan Phiffer
Post by R***@gmail.com
Can greasemonkey/javascript read a .txt file? If so how?
That depends, is the text file on a server somewhere? If so, you can
use GM_xmlhttpRequest.
Post by R***@gmail.com
Like I need it to read the first line of a .txt file and store
whatever is on the first line into a greasemonkey variable, which I
can later address.
To store data for later you can use GM_setValue and GM_getValue.
Search for the documentation on those to get started.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-***@googlegroups.com
To unsubscribe from this group, send email to greasemonkey-users-***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Dan Phiffer
2007-09-14 05:30:24 UTC
Permalink
Post by R***@gmail.com
Actually, its a text file on my own computer and has nothing to do
with the website. I dunno if theres something that can be done.
I'm pretty sure you don't want Greasemonkey scripts arbitrarily
checking out your local files (plus there are security limitations
preventing you from doing this). You could throw caution to the wind
and set up a local web server exposing the directory where the file
lives. Or write a proper Firefox extension.
Post by R***@gmail.com
Post by Dan Phiffer
Post by R***@gmail.com
Can greasemonkey/javascript read a .txt file? If so how?
That depends, is the text file on a server somewhere? If so, you can
use GM_xmlhttpRequest.
Post by R***@gmail.com
Like I need it to read the first line of a .txt file and store
whatever is on the first line into a greasemonkey variable, which I
can later address.
To store data for later you can use GM_setValue and GM_getValue.
Search for the documentation on those to get started.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-***@googlegroups.com
To unsubscribe from this group, send email to greasemonkey-users-***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...