Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

PR Checklist

  • Functionality has been tested, no obvious bugs
  • Code style follows project conventions
  • Documentation/comments updated (if applicable)

Brief Description of Changes

Adds configurable file extension filtering for security use cases. IT admins can now block or allow specific file extensions from being previewed.

New: QuickLook/Helpers/ExtensionFilterHelper.cs

  • Manages allowlist/blocklist with caching
  • Two modes: blocklist (default) or allowlist
  • Case-insensitive matching, directories always allowed

Modified: ViewWindowManager.cs

  • Extension filter check in InvokePreview() and InvokePluginPreview()
  • Optimized to reuse directory existence check

Configuration (in QuickLook.config via Data Folder):

<!-- Blocklist mode (default): block specific extensions -->
<ExtensionBlocklist>.exe;.bat;.cmd</ExtensionBlocklist>

<!-- Or allowlist mode: only allow specific extensions -->
<UseExtensionAllowlistMode>true</UseExtensionAllowlistMode>
<ExtensionAllowlist>.jpg;.png;.pdf</ExtensionAllowlist>

Related Issue (if any)

Fixes #1797

Additional Notes

  • Empty lists = no filtering
  • Directories and files without extensions are always allowed
  • Settings are read from standard config location (accessible via tray icon → "Open Data Folder")
Original prompt

This section details on the original issue you should resolve

<issue_title>White/Black list for allowed/blocked file extensions in a settings page</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

As an IT-sysadmin, I want to be able to whitelist allowed file extensions. There are some file extensions that should for security reasons not be run, since this can be an attack vector, some files types are safer to preview than others.

Describe the solution you'd like
I want a simple white/black list of what file extensions are allowed/disallowed to be previewed by quicklook. This could be in a setting page if you right-click on the quicklook symbol. (In this page could be also listed what files type are currently able to be previewed.)

Additional context
This would be a great security feature.
</issue_description>

<agent_instructions>White/Black list for allowed/blocked file extensions in settings options</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@emako There are already some attempts at PR: [github.com//pull/1803](https://github.com//pull/1803)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits November 26, 2025 21:12
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
…or array

Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copilot AI changed the title [WIP] Add white/black list for file extensions in settings page Add file extension allowlist/blocklist filtering Nov 26, 2025
Copilot AI requested a review from emako November 26, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

White/Black list for allowed/blocked file extensions in a settings page SVG preview window is always dark

2 participants