Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4609524
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:59:56+00:00 2026-05-22T00:59:56+00:00

From what I understood, it is not possible to read files using Greasemonkey. I

  • 0

From what I understood, it is not possible to read files using Greasemonkey. I need to define lot of static configuration files, and it seems completely messy to include those directly in the user script.

So, what is the best way to store and retrieve that data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:59:57+00:00Added an answer on May 22, 2026 at 12:59 am

    Yes, it is not possible, by design, to read local files.

    If your files are all a page or so of text, and don’t change that often, go ahead and use GM_getResourceText(), per Dr.Molle’s answer.

    If your files are large, or change rapidly, then host them on a server and use GM_xmlhttpRequest() to read back the file you need, at runtime. See item 2, below.


    1. Using GM_getResourceText() is the easiest and fastest way to proceed. And, if the config files are reasonably sized (say less than 1K on average), this method will probably be faster than methods that rely on Ajax — even with 150 (!!!) files.

      Drawback: You will have to bookmark an awkward path and remember it, when you want to edit a config file. (EG: C:\Documents and Settings\<Windows login/user name>\Application Data\Mozilla\Firefox\Profiles\<profile folder>\gm_scripts\YOUR_SCRIPT_NAME\ )

    2. If you really can’t — or don’t want to — use a bunch of relatively static files, the best choice is to host the config files on your server and have GM_xmlhttpRequest() read the needed file when the script runs.

      If you do not have your own server, then you can host the files someplace like Google Docs.

    3. Using GM_getValue() or using globalStorage or local storage can all be very fast and efficient about getting your config file data (and only the data you want). But, storing the data can be a major pain unless you write your own tools to do so (also a pain, but others have done it).

    4. Using @require offers no advantage over GM_getResourceText() unless your config files are really valid JavaScript code. And, this method will require you to uninstall and then reinstall your script every time the name of an include file changes — or if you add or delete files.
      Not recommended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using DBus in a project. I understand from DBus specification that for
Is it possible to delete-protect a file/folder using Registry or using a custom written
I am attempting to pull some information from my tnsnames file using regex. I
From what I understand, the parent attribute of a db.Model (typically defined/passed in the
From what I understand, due to the same origin policy enforcement in current browsers,
From what I understand, in TDD you have to write a failing test first,
From what I understand of the SDK, this exception is raised when the bindings
I understand the main function of the lock key word from MSDN lock Statement
I don't understand where the extra bits are coming from in this article about
I'm trying to understand a particular Perl code from vcake . Usually I find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.