NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
If you like this script, please consider buying me a coffee or making a donation, leaving a rating, or sending me a comment to let me know what you think. Thank you!
This script works on local directories as well as many remote server-generated index pages ("open directories"). Remote server URLs can be added in the script settings provided by your userscript manager (e.g., greasemonkey or tampermonkey). Because server configurations vary, the script may not work perfectly (or at all) on some sites (in particular, it does not work with servers "Powered by h5ai" or "Directory Lister"). Very large directories (> 1000 items) may cause the browser to choke. Please let me know if you encounter any problems.
NOTE: This script was developed in the latest version of Vivaldi, running on MacOS. It has been minimally tested in other Chrome-based browsers, Safari, and Firefox, and has been not been tested in any other browsers or OSes. No effort has been made to ensure compatibility with older browsers. Please report any issues.
VERSION 7.0.1 (2022-05-15): Bugfixes
IMPROVED: Close button behavior with font previews.
FIXED: A few other bugs and UI issues with font previews.
FIXED: Buy me a Coffee link didn't work. (SMH)
FIXED: Clicking parent links didn't work.
FIXED: Hovering grid items did not highlight the corresponding sidebar item.
FIXED: Various bugs involving grid functions when the grid contains items from closed subdirectories.
FIXED: Links in previewed HTML files were not being handled correctly.
VERSION 7.0.0 (2022-02-26): Major internal changes
IMPROVED: Removed jQuery dependency.
IMPROVED: Greatly improved efficiency of initial page processing.
ADDED: Option to show image thumbnails in sidebar and previewed directories. (Enabling this option may slow down page load.)
ADDED: Option to show or hide item details in previewed directories.
ADDED: Buy me a Coffee link
IMPROVED Font preview and font file glyph display
OTHER:
Still to do:
BEFORE
AFTER with dark theme and image grid
MEDIA PLAYBACK with dark theme and cover art
MARKDOWN editing and preview, with subdirectory browsing
FONT GRID
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 buying me a coffee or making a donation to encourage development. Thanks!
FEATURES INCLUDE:
${toc}
) ( https://github.com/nagaozen/markdown-it-toc-done-right )\[ ], [x]
), allowed in lists and deflists.^sup^
) ( https://github.com/markdown-it/markdown-it-sup )~sub~
) ( https://github.com/markdown-it/markdown-it-sub )->centered<-
) ( https://github.com/jay-hodgson/markdown-it-center-text )IMPORTANT NOTES:
This script was developed in the latest version of Vivaldi, running on Mac OS Mojave. It has been tested in Safari, Firefox, and various Chrome-based browsers, but it has been not been tested in any other browsers or OSes, and no effort has been made to ensure compatibility with older browsers. Please report any issues.
After installing, you should look at the "User Settings" section in the code near the top of the script (ca. line 60). There you can edit the bookmark menus and set defaults for many UI features. There is additional information about each setting in the comments.
Userscripts will not run on file:/// urls by default, so for this script to work, you will have to enable it in your browser's 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).
This script was developed primarily to work with local files. Because of security concerns, userscripts running in local files are not allowed to set cookies or use local storage. Therefore the User Settings must be hard-coded into the script, which means they will be overwritten every time the script is updated. To ease the inconvenience of this, you can export your settings from the main menu as a text file. However, many user settings can be changed in the UI and will be stored in the URL query string.
The script works on many server-generated index pages, too. Just add an @include line for each url at the top of the script.
KEYBINDINGS (These don't work in all browsers):
CHANGELOG:
VERSION 6.3.3 (2021-08-18)
FIXED: Autoload media (and possibly a few other functions) wasn't working.
VERSION 6.3.2 (2021-08-01)
FIXED: Linked stylesheets weren't being removed from previewed directories.
ADDED: mkv and mka to the list of supported media formats. (N.b.: This script does not enable your browser to play these formats; it may require a plugin to do so.)
OTHER: Minor compatibility improvements and UI tweaks.
VERSION 6.3.1 (2021-06-20)
IMPROVED: Compatibility with additional server configurations
OTHER: A few minor UI fixes.
VERSION 6.3.0 (2021-06-13):
IMPROVED: Compatibility with some server configurations.
FIXED: Some long-standing issues with HTTP error handling. Error pages will now be displayed in the sidebar or content pane, according to context.
ADDED: Clicking items in the stats footer details view will also change the view to sort by kind.
VERSION 6.2.0 (2021-05-28):
ADDED: Add stats footer to content pane for directory previews.
ADDED: Show total media durations in stats footer.
FIXED: Media durations were not showing in subdirectory listings.
FIXED: Sidebar stats footer was not displayed for playlists/filelists
VERSION 6.1.6: (2021-04-10) MINOR UPDATE:
Added script icon.
Hopefully fixed some cosmetic issues with scrollbars.
VERSION 6.1.5: (2021-02-13)
FIXED: Cuesheets weren't being processed correctly.
VERSION 6.1.4: (2021-01-29)
FIXED: Media autoplay failed if the next track was of a different kind (e.g., video after audio).
FIXED: Textareas and form elements in HTML pages could not be focussed when clicked.
VERSION 6.1.3: (2021-01-13)
FIXED: Various issues with keyboard navigation in the content pane.
FIXED: Various issues with audio playback from the content pane
FIXED: The Prev/Next buttons did not loose focus after being clicked.
FIXED: A rare bug with processing paths containing a “ (left double quote) followed by a " (straight quote).
OTHER: Updated markdown-it to 12.0.4.
VERSION 6.1.6: (2021-04-10) MINOR UPDATE:
VERSION 6.1.2: (2021-01-04)
FIXED: An issue with media playback when one or more items were unchecked.
VERSION 6.1.1: (2020-12-29)
FIXED: Some issues with the reload button.
VERSION 6.1.0: (2020-12-23)
ADDED: Button to open html files in the text editor.
ADDED: Click an item in the Stats menu to select the first matched item in the directory list.
ADDED: Double-click the resize handle in the text editor to reset the visible panes width to 50%.
FIXED: An issue with tabbing into html files with links or other selectable elements.
FIXED: UI prefs for the text editor weren't being set or honored between sessions.
FIXED: Various issues with sync scroll and resizing the text editor panes.
FIXED: An issue where playlist items with a ? in the pathname were not processed correctly.
FIXED: Long cue sheet menus couldn't be scrolled.
Many other bugfixes.
VERSION 6.0.0 (2020-09-07):
SUBDIRECTORIES! (You can thank me here.) Media additions and improvements: durations, playlists, cue sheets, and more.
(NOTE: Some internal prefs and settings have been changed. If you find that a previously open page doesn't load correctly after updating, try clicking "Default User Settings" in the main menu, or deleting the query string from the page url.)
NEW: Now you can browse subdirectories in directory indexes!
Click the directory icon to show the subdirectory's contents; click again to close it. You can also use Cmd/Ctrl-Right Arrow to open it and Cmd/Ctrl-Left Arrow to close it. (If this doesn't convince you to send me some love, I don't know what will.)
For now, sorting of subdirectories is not supported; clicking a new sort will close all open subdirectories.
NEW: Show length/duration of media tracks(!); allow sorting by track duration.
NEW: Basic support for .cue sheet files.
When a media file (audio or video) is loaded from the sidebar, the script will look for a .cue file in the same directory with EXACTLY the same name as the media file.
If it finds one, it will load the Track ID, the PERFORMER, the TITLE, and the INDEX (time position) from the cuesheet into a menu next to the audio player or in the title bar for videos; there is no support for other cue sheet commands.
Selecting one of the tracks will jump media playback to that time.
Note: .cue files can be selected independently in the sidebar and edited and saved (locally), or created in the Text Editor. This may be handy for creating a bookmark for a long media track when a .cue file is not available (for example, for an audiobook downloaded from YouTube).
Note (MacOS): If you prefer not to clutter the sidebar with .cue files, you can make them invisible by adding a dot to beginning of the file name; the script will still find them.
IMPROVED: Playlist files: Although .m3u files are just plain text, the browser interprets them as binary and will not open them; this is why the script has the "Open Playlist" menu item.
However, if you change the playlist extension to .txt, the script will be able to read the file as editable text as usual.
What's new is that if you select such a renamed playlist in the sidebar and then double-click it or type Cmd/Ctr + Down Arrow or
Cmd/Ctr + Return, the script will load the playlist in the sidebar.
NOTE: The renamed .m3u file must be in EXTM3U format.
ADDED: Option to allow playback of all media files( i.e., audio and video), not just the currently selected media type.
ADDED: "Close Playlist" menu item and button which are visible when a playlist/filelist is open.
FIXED: Cmd+W did not close playlists.
ADDED: Loop and shuffle playback options for video files.
FIXED: Loop audio playback was broken.
ADDED: New menu item: "Media Files", with options to "Play All Media Files," "Loop Media", and "Shuffle Media"; the latter two are useful when viewing video files.
FIXED: Media tracks should scroll into view when track ends and next track begins playback.
FIXED: Playlists: caps in file extensions caused incorrect file type detection.
FIXED: Various issues with closing previewed content.
FIXED: Setting text editing options was broken.
FIXED: Handling of HTTP error pages wasn't working. Oh, the irony.
FIXED: "View Sidebar Directory Source" wasn't working.
FIXED: Some issues with autoloading files from file (i.e., not directory) URLs.
CHANGED: Reorganized main menu to make it more compact.
CHANGED: Audio player now displayed at top of content pane, so that the content title is visually connected to the displayed content.
CHANGED: Added .m3u files to the list of ignored formats.
CHANGED: Disabled media checkboxes in Firefox, because Firefox s*cks.
UPDATED Help menu with additional information.
IMPROVED: If you navigate up to a parent directory that contains audio, images, and directories, and if autoloadmedia === true, and if the script's navigation history includes the parent directory, the parent directory will be selected in the sidebar for navigation, while the audio and image file will be loaded and highlighted in the sidebar.
IMPROVED: .webloc and .url files can be opened from preview pane.
IMPROVED: Hovering specific items in the stats will scroll the first instance of that kind in the sidebar into view. Also limited max-height of stats and allowed scrolling.
OTHER: Completely reworked the code for getting directory stats.
OTHER: A few UI refinements.
OTHER: More performance improvements: Removed a bunch of redundant code and function calls, reduced initial DOM manipulations, converted many strings to template literals for more efficient parsing and concatenation.
OLDER CHANGES
VERSION 4.1.2
FIXED, CHANGED, & IMPROVED: Image, font, and font glyph grids.
FIXED and IMPROVED: Playlists.
IMPROVED: Currently selected sidebar item will now scroll into view after various events, like sorting change, showing/hiding details, resizing sidebar, etc.
FIXED: Several menu items weren't working: Default User Settings, Export User settings, Contact, and Donate (that might explain a few things...).
FIXED: Document title didn't include entire path.
Many other small bug fixes and style tweaks, including some specifically for Firefox and Safari.
VERSION 4.1.1
A few small fixes and style tweaks.
VERSION 4.1.0
NEW: Basic support for media playlists (.m3u and .m3u8).
VERSION 4.0.6.1
FIXED: Really updated markdown-it and plugins.
VERSION 4.0.6
FIXED: An issue with video display.
FIXED: Several styling issues in Firefox, including textarea
in text editor not expanding to full window height.
FIXED: An issue with some servers that add a trailing '/' to the query string.
IMPROVED: Updated markdown-it to v9.0.1; also updated some markdown-it plugins.
NEWS: Version 4.1, with a new feature of interest to designers, is in development.
VERSION 4.0.5b
IMPROVED: Clicking "Parent Directory" link in previewed directories now remembers sorting and numbering prefs.
FIXED: Hopefully fixed close content behavior.
FIXED: Several bugs with sorting items by size.
FIXED: Various minor styling issues and tweaks.
Known issue: PDFs don't always display when selected; this seems to be an issue with Chrome. I will attempt to address this in future updates.
VERSION 4.0.4b Wrapping things up....
Known Issue: Close button function is buggy, particularly with Text Editor and Grids. Fixes coming.
FIXED: Left/Right arrow key navigation failed for video files
FIXED: Content preview title wasn't being set for autoloaded images.
FIXED: An issue with autoloading media and cover art when the first media file was a video.
FIXED: Various issues with parsing local directory indexes in Firefox.
FIXED: Various issues with parsing, calculating, and displaying file size and date-modified information.
IMPROVED: Attempted to make index-type detection and index prep more generic, so that the script will work with more sites "out of the box."
IMPROVED: Made index prep much more efficient, especially for table-type index pages and directories with many items.
IMPROVED: Better error handling for directories with certain percent-encoded characters in file names.
IMPROVED: Changed order of sorting headers to better align with sort data in list.
OTHER: More minor styling issues and improvements.
Please report any bugs or feature requests to mshroud AT gmail.com.
And please consider buying me a coffee (or just let me know what you think), if you find the script useful. Thanks!
VERSION 4.0.3b
ADDED: Preview current directory index source: click the double-caret icon in the sidebar stats footer to toggle preview. This is useful for server configurations that include information in addition to the index itself and is quicker than opening a separate "View source" tab.
FIXED: An issue with content display caused by the fix for pdf display in the previous version.
FIXED: Up directory navigation didn't correctly account for invisible files and directories when selecting previously selected directory.
FIXED: More issues with prepping "pre"-type index pages.
FIXED: Some issues with Error page display.
FIXED: Various minor styling issues.
CHANGED: Moved "Disable Text Editing" menu item to top level.
Many other small improvements and tweaks.
VERSION 4.0.2b
FIXED: Pdf display (I hope).
VERSION 4.0.1b
FIXED: Audio files weren't being loaded.
FIXED: Script would fail if a file name included a special regex character [\^$.|?*+()
.
FIXED: Various issues with parsing "pre"-type index pages.
IMPROVED: Sorting and display of items with names beginning with white spaces.
IMPROVED: More efficient and robust index type detection.
ADDED: Sorting for previewed directory contents. Initial sorting is the same as the parent's current sort pref.
ADDED: Custom icons and numbering for previewed directory contents; numbering reflects the parent's current numbering pref.
NOTE: There is an issue with Chrome browsers and pdf file display, so pdfs don't display reliably.
NOTE: Some further fixes and styles tweaks coming.
VERSION 4.0.0b:
Numerous additions, improvements, and massive internal changes. Virtually no line of code has been left untouched. "b" === "bugs" likely; updates will be forthcoming.
IMPORTANT: This version uses a new format for user settings in the code; you will have to re-enter your defaults manually after updating.
- Do NOT use exported settings from any earlier version of the script.
NEW: Added independent text editor pane.
postMessage
to communicate between iframe and parent.Rating: 5