Jump to content

User:PerfektesChaos/js/localFileContent

From Wikipedia, the free encyclopedia

Methods to integrate text from local files into a wiki page, or any other HTML page.

With Firefox 28.0 in March 2014 usage of resources via file:/ has been blocked for security reasons. Basically this is okay, but a nuisance for those who are developing scripts on local file system. Greasemonkey permits usage of local scripts, but does not permit versioning, backup switching and IDE, since Greasemonkey storage is somewhere in the browser application folder with arbitrary file names.

The localFileContent package gives access to some local files under security considerations:

  • URL of pages which are permitted to access needs to be defined explicitly by regular expression.
  • Only selected files may be accessed by any webpage.
  • File content is not accessed by file name and path, but by MIME type and nickname. While the request might be visible on a web page script, the assignment between nickname and current path is kept local.

For testing and development this offers new opportunities:

  • Particular access might be linked to different files; release version or debugging mode or a temporary test version.
  • A feature to switch an assignment on and off quickly is provided, making the web page using productive web resource as fallback or a local debugging file if activated.

Firefox – Add-on