gaspar_schot / Supercharged Local Directory File Browser

Published:

Version: 3.2.2+6b65d1f updated

Summary: Makes file:/// directory ("Index of...") pages (and many server-generated index pages) actually useful. Adds sidebar and preview pane, keyboard navigation, audio and video player, markdown/plain text preview and editing, image and font previews and grid views, sorting, user-defined shortcuts, more.

Groups:

Homepage: https://openuserjs.org/scripts/gaspar_schot/Supercharged_Local_Directory_File_Browser

License: GPL-3.0-or-later

VERSION 3.2.2 More bug fixes.
FIXED: Source text was being interpreted as HTML.
FIXED: Checkboxes added to markdown weren't "live."
IMPROVED: Live preview update on input.
IMPROVED: Nested blockquote styling.

VERSION 3.2.1
FIXED: A bad bug with saving source text.
IMPROVED: Made text split-view resizable.
IMPROVED: Various UI tweaks for text editing.

VERSION 3.2.0
NEW!: Preview, edit, and save Markdown and plain-text files. (Now how much would you pay? Or donate? :-)
    • Basic Markdown syntax is rendered via markdownit.js.
    • View editable source text or rendered HTML preview, or both in split pane (with optional sync scroll).
    • Live preview of source edits in split-pane view.
    • Render Checkboxes/Checklists with [x] and [ ], with live updating of source text.
    • Save edited source text or rendered HTML.
    • More to come.
    • Caveat: You must manually save your work if you want to keep it; autosave is not possible.
        Moreover, because of security concerns with local files, the editing iframe cannot communicate with the parent index page, or vice versa.
        * It is therefore entirely possible to navigate away from the page and LOSE YOUR WORK. *
        To help prevent loss of work, the script will attempt to warn you when the editing pane loses focus (if you have made any edits), e.g., when you click in the script sidebar or in the browser UI, or when the browser tab/window or the browser itself loses focus. But note that if the editing pane is already unfocused, the warning will not be issued.
ADDED: New user settings: set default view for markdown/text files: source or preview, or split pane view. See user settings for details.
IMPROVED: Plain text and code file type detection.
CHANGED: Treat files without extensions as text (code) files. (Extension-less binary files will still initiate a download.)
FIXED: Malformed URI error if file name included "%".
FIXED: Some issues with image zoom.
FIXED: An issue with content pane sizing.
FIXED: An issue with parent directory navigation.

ABOUT
This script transforms the default local directory page (and many server-generated index pages) into a full-featured file browser, with a resizable sidebar and preview pane. (See screenshots below.)

If you like this script, please consider making a donation to encourage development. Thanks!

FEATURES INCLUDE:

  • Resizable sidebar and file preview pane.
  • Keyboard navigation in sidebar.
  • Sort files in sidebar.
  • Preview all file types supported by browser (html, text, images, pdf, audio, video) plus fonts.
  • Preview and edit markdown and plain text files.
  • Audio and video playback, with shuffle, loop, skip ahead and behind; view other files in directory while playing audio.
  • Grid view for images and fonts.
  • Light and Dark theme.
  • Show/Hide file details.
  • User-definable bookmarks for directories.
  • User settings for various UI features.

IMPORTANT: After installing, you should look at the "User Settings" section in the code at the top of the script. There you can edit the shortcut menus and set defaults for many UI features. There is additional information in the comments.

NOTE: By default, userscripts will not run on file:/// urls, so for this script to work, you will have to enable it in your browser extension settings (e.g.: For Tampermonkey in Chrome, go to Chrome the extension page, click the details button on the Tampermonkey pane and check 'Allow access to file URLs').
Safari does not allow local directories to be browsed, so the script will not work on local directories, but it will work on remote directories (or on local directories through a local server).

NOTE: The script works on many server-generated index pages, too. Just add an @include line for each url at the top of the script.

NOTE: This script was developed in Vivaldi, running on Mac OS High Sierra. It has been tested in several other Chrome and Gecko-based browsers. It has been very minimally tested on Windows and not at all on other OSes or browsers. It should work, but please report any issues. No attempt has been made to support older browsers.

KEYBINDINGS:
Arrow Up/Down: Select prev/next item. If audio is playing, and prev/next file is also audio, it will be selected but not loaded in the audio player; press return to load it.
Arrow Left/Right: Select prev/next row of the same kind as the current selection, except if current selection is a media file, select and begin playback of that item.
Cmd/Ctrl + Arrow Up: Go to parent directory
Opt/Alt + Arrow Left/Right: Skip audio ±10s
Shift + Opt/Alt + Arrow Left/Right: Skip audio ±30s
Space: Pause/Play media files
Return: Open selected directory, select file, or pause/play media.
Cmd/Ctrl + D: Toggle file details (size, date modified) in some index page types.
Cmd/Ctrl + G: Show or Reset Grid
Cmd/Ctrl + I: Toggle Invisibles
Cmd/Ctrl + Shift + O: Open selected item in new window/tab
Cmd/Ctrl + R: Reload grids and previewed content, reset scaled images/fonts, reset media files to beginning.
Cmd/Ctrl + W: Close previewed content (doesn't work in all browsers; use close button instead), or close window if no content is being previewed.
Cmd/Ctrl + Shift + : Scale preview items and grids.

Before
Before

After with dark theme and image grid
After with dark theme and image grid

Audio player with dark theme and cover art
Audio player with dark theme and cover art

Light theme with image and font grid
Light theme with font and image grid

Markdown editing and preview
Markdown editing and preview

Rating: 1

1 Votes
-1