Compare commits

..

8 Commits

Author SHA1 Message Date
ema
97ebb410fb Add .cnf extension to INI syntax highlighting
Some checks are pending
build / build (push) Waiting to run
build / publish (push) Blocked by required conditions
Updated both dark and light INI.xshd syntax definition files to include the .cnf extension, enabling proper syntax highlighting for .cnf files.
2025-12-12 02:29:25 +08:00
ema
d945cc914e Update Magick.NET-Q8-AnyCPU to version 14.10.0
https://github.com/QL-Win/QuickLook/security/dependabot/13
2025-12-12 02:19:43 +08:00
ema
2721df459d Update changelog for 4.3.0 release
Some checks failed
build / build (push) Has been cancelled
build / publish (push) Has been cancelled
2025-12-10 00:24:26 +08:00
ema
85b1e9b024 Update NuGet package versions in plugin projects 2025-12-09 23:57:57 +08:00
ema
291ab79822 Remove AppVeyor badge and references from README
Eliminated the AppVeyor build badge and related nightly build reference from the README, reflecting a shift to GitHub Actions for CI and nightly builds.
2025-12-09 23:32:10 +08:00
ema
11961088f1 Update CI workflow and README badges
Renamed the MSBuild workflow to 'build' and updated actions/checkout to v4 in the workflow file. Added GitHub Actions badge to README and reordered platform badge for improved visibility.
2025-12-09 23:29:14 +08:00
ema
c5b4014fad Add Windows platform badge to README
A badge indicating Windows as the supported platform has been added to the README for clearer platform identification.
2025-12-09 23:23:23 +08:00
ema
7211c2ebdd Update PowerShell syntax colors in dark theme
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled
Changed the color values for Keywords2 and Keywords3 in the PowerShell.xshd dark theme file to use specific hex codes instead of named colors for improved consistency and appearance.
2025-12-05 13:40:57 +08:00
13 changed files with 29 additions and 225 deletions

View File

@@ -1,6 +1,6 @@
# run a build for the latest version and upload the artifacts to a "latest" pre-release
name: MSBuild
name: build
on:
push:
@@ -26,7 +26,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

View File

@@ -1,3 +1,14 @@
## 4.3.0
- Add Svelte syntax highlighting support
- Add ShowInTaskbar setting to display window in taskbar [#1789](https://github.com/QL-Win/QuickLook/issues/1789)
- Add option to disable automatic update check at startup [#1801](https://github.com/QL-Win/QuickLook/issues/1801)
- Update PowerShell syntax colors in dark theme
- Improve TextViewerPanel UI and usability
- Fix DOpus crash when QuickLook runs with different privilege level [#1781](https://github.com/QL-Win/QuickLook/issues/1781)
- Fix volume control exceeding limits during mouse wheel scroll [#1813](https://github.com/QL-Win/QuickLook/issues/1813)
- Fix error in RTF file originating from version 4.2.1 [#1826](https://github.com/QL-Win/QuickLook/issues/1826)
## 4.2.2
- Fix version display issue [#1776](https://github.com/QL-Win/QuickLook/issues/1776)

View File

@@ -73,7 +73,7 @@
<ItemGroup>
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -61,7 +61,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -59,13 +59,13 @@
<PackageReference Include="QuickLook.ImageGlass.WebP" Version="1.4.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.10.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Google.Protobuf" Version="3.33.1">
<PackageReference Include="Google.Protobuf" Version="3.33.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Memory" Version="4.6.3">

View File

@@ -61,7 +61,7 @@
<ItemGroup>
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
<Reference Include="WindowsBase" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -64,7 +64,7 @@
<ItemGroup>
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="144.0.7543" />
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="145.0.7568" />
<Reference Include="WindowsBase" />
</ItemGroup>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="INI" extensions=".ini;.inf;.wer;.dof;.toml;.gitmodules;.editorconfig">
<SyntaxDefinition name="INI" extensions=".ini;.inf;.cnf;.wer;.dof;.toml;.gitmodules;.editorconfig">
<Environment>
<Default color="#D4D4D4" bgcolor="#1E1E1E"/>

View File

@@ -93,7 +93,7 @@
<Key word="workflow"/>
</KeyWords>
<KeyWords name="Keywords2" color="Purple" bold="false" italic="false">
<KeyWords name="Keywords2" color="#D8A0DF" bold="false" italic="false">
<Key word="Add-Computer"/>
<Key word="Add-Content"/>
<Key word="Add-History"/>
@@ -439,7 +439,7 @@
<Key word="Write-Zip"/>
</KeyWords>
<KeyWords name="Keywords3" color="Teal" bold="false" italic="false">
<KeyWords name="Keywords3" color="#80CBC4" bold="false" italic="false">
<Key word="ac"/>
<Key word="asnp"/>
<Key word="cat"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="INI" extensions=".ini;.inf;.wer;.dof;.toml;.gitmodules;.editorconfig">
<SyntaxDefinition name="INI" extensions=".ini;.inf;.cnf;.wer;.dof;.toml;.gitmodules;.editorconfig">
<Environment>
<Default color="Black" bgcolor="#FFFFFF"/>

View File

@@ -1,198 +0,0 @@
// Copyright © 2017-2025 QL-Win Contributors
//
// This file is part of QuickLook program.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using QuickLook.Common.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace QuickLook.Helpers;
/// <summary>
/// Helper class for managing file extension allowlist/blocklist filtering.
/// <para>
/// <b>Blocklist mode (default):</b> All extensions are allowed except those in the blocklist.
/// If the blocklist is empty, all files are allowed.
/// </para>
/// <para>
/// <b>Allowlist mode:</b> Only extensions in the allowlist can be previewed.
/// If the allowlist is empty in allowlist mode, all files are allowed (no filtering).
/// </para>
/// <para>
/// Directories and files without extensions are always allowed regardless of the mode.
/// </para>
/// </summary>
public static class ExtensionFilterHelper
{
private const string AllowlistKey = "ExtensionAllowlist";
private const string BlocklistKey = "ExtensionBlocklist";
private const string UseAllowlistModeKey = "UseExtensionAllowlistMode";
private static readonly char[] ExtensionSeparators = [';', ','];
private static HashSet<string> _allowlistCache;
private static HashSet<string> _blocklistCache;
private static bool? _useAllowlistModeCache;
/// <summary>
/// Gets or sets whether to use allowlist mode.
/// When true, only extensions in the allowlist can be previewed.
/// When false (default), extensions in the blocklist are blocked from preview.
/// </summary>
public static bool UseAllowlistMode
{
get
{
_useAllowlistModeCache ??= SettingHelper.Get(UseAllowlistModeKey, false);
return _useAllowlistModeCache.Value;
}
set
{
_useAllowlistModeCache = value;
SettingHelper.Set(UseAllowlistModeKey, value);
}
}
/// <summary>
/// Gets the current allowlist of file extensions.
/// Extensions should be in the format ".ext" (with leading dot).
/// </summary>
public static HashSet<string> Allowlist
{
get
{
if (_allowlistCache == null)
{
var list = SettingHelper.Get(AllowlistKey, string.Empty);
_allowlistCache = ParseExtensionList(list);
}
return _allowlistCache;
}
}
/// <summary>
/// Gets the current blocklist of file extensions.
/// Extensions should be in the format ".ext" (with leading dot).
/// </summary>
public static HashSet<string> Blocklist
{
get
{
if (_blocklistCache == null)
{
var list = SettingHelper.Get(BlocklistKey, string.Empty);
_blocklistCache = ParseExtensionList(list);
}
return _blocklistCache;
}
}
/// <summary>
/// Sets the allowlist of file extensions.
/// </summary>
/// <param name="extensions">Collection of extensions in the format ".ext" (with leading dot).</param>
public static void SetAllowlist(IEnumerable<string> extensions)
{
var normalized = NormalizeExtensions(extensions);
_allowlistCache = normalized;
SettingHelper.Set(AllowlistKey, string.Join(";", normalized));
}
/// <summary>
/// Sets the blocklist of file extensions.
/// </summary>
/// <param name="extensions">Collection of extensions in the format ".ext" (with leading dot).</param>
public static void SetBlocklist(IEnumerable<string> extensions)
{
var normalized = NormalizeExtensions(extensions);
_blocklistCache = normalized;
SettingHelper.Set(BlocklistKey, string.Join(";", normalized));
}
/// <summary>
/// Checks if a file path is allowed for preview based on the current filter settings.
/// </summary>
/// <param name="path">The file path to check.</param>
/// <returns>True if the file is allowed for preview, false if it should be blocked.</returns>
public static bool IsExtensionAllowed(string path)
{
if (string.IsNullOrEmpty(path))
return true;
var extension = Path.GetExtension(path);
// Files without extensions are always allowed (includes directories)
if (string.IsNullOrEmpty(extension))
return true;
extension = extension.ToLowerInvariant();
if (UseAllowlistMode)
{
// In allowlist mode: only allow if extension is in the allowlist
// If allowlist is empty, allow all (no filtering)
return Allowlist.Count == 0 || Allowlist.Contains(extension);
}
else
{
// In blocklist mode: block if extension is in the blocklist
return !Blocklist.Contains(extension);
}
}
/// <summary>
/// Clears the cached settings, forcing a reload from the config file.
/// </summary>
public static void ClearCache()
{
_allowlistCache = null;
_blocklistCache = null;
_useAllowlistModeCache = null;
}
private static HashSet<string> ParseExtensionList(string list)
{
if (string.IsNullOrWhiteSpace(list))
return new HashSet<string>(StringComparer.OrdinalIgnoreCase);
return new HashSet<string>(
list.Split(ExtensionSeparators, StringSplitOptions.RemoveEmptyEntries)
.Select(NormalizeExtension)
.Where(e => !string.IsNullOrEmpty(e)),
StringComparer.OrdinalIgnoreCase);
}
private static HashSet<string> NormalizeExtensions(IEnumerable<string> extensions)
{
return new HashSet<string>(
extensions.Select(NormalizeExtension).Where(e => !string.IsNullOrEmpty(e)),
StringComparer.OrdinalIgnoreCase);
}
private static string NormalizeExtension(string ext)
{
if (string.IsNullOrWhiteSpace(ext))
return null;
ext = ext.Trim().ToLowerInvariant();
if (!ext.StartsWith("."))
ext = "." + ext;
return ext;
}
}

View File

@@ -151,15 +151,10 @@ public class ViewWindowManager : IDisposable
if (_viewerWindow.IsVisible && path == _invokedPath)
return;
var isDirectory = Directory.Exists(path);
if (!isDirectory && !File.Exists(path))
if (!Directory.Exists(path) && !File.Exists(path))
if (!path.StartsWith("::")) // CLSID
return;
// Check extension filtering before proceeding (skip for directories)
if (!isDirectory && !ExtensionFilterHelper.IsExtensionAllowed(path))
return;
_invokedPath = path;
RunFocusMonitor();
@@ -177,12 +172,7 @@ public class ViewWindowManager : IDisposable
if (string.IsNullOrEmpty(path))
return;
var isDirectory = Directory.Exists(path);
if (!isDirectory && !File.Exists(path))
return;
// Check extension filtering before proceeding (skip for directories)
if (!isDirectory && !ExtensionFilterHelper.IsExtensionAllowed(path))
if (!Directory.Exists(path) && !File.Exists(path))
return;
RunFocusMonitor();

View File

@@ -5,7 +5,8 @@
<a href="https://trendshift.io/repositories/3258" target="_blank"><img src="https://trendshift.io/api/badge/repositories/3258" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[![license](https://img.shields.io/github/license/QL-Win/QuickLook.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![AppVeyor](https://img.shields.io/appveyor/ci/xupefei/QuickLook.svg)](https://ci.appveyor.com/project/xupefei/QuickLook)
[![Actions](https://github.com/QL-Win/QuickLook/actions/workflows/msbuild.yml/badge.svg)](https://github.com/QL-Win/QuickLook/actions/workflows/msbuild.yml)
[![Platform](https://img.shields.io/badge/platform-Windows-blue?logo=windowsxp&color=1E9BFA)](https://dotnet.microsoft.com/en-us/download/dotnet/latest/runtime)
[![Github All Releases](https://img.shields.io/github/downloads/QL-Win/QuickLook/total.svg)](https://github.com/QL-Win/QuickLook/releases)
[![GitHub release](https://img.shields.io/github/release/QL-Win/QuickLook.svg)](https://github.com/QL-Win/QuickLook/releases/latest)
@@ -36,7 +37,7 @@ Get it from one of the following sources:
* Microsoft Store (Windows 10 and later only). Not supported on Windows 10 S. Not support file preview in Open-File or Save-File dialogs. <a href="https://www.microsoft.com/store/apps/9nv4bs3l1h4s?ocid=badge" target="_blank"><img src="https://developer.microsoft.com/store/badges/images/English_get_L.png" height="22px" alt="Store Link" /></a>
* Installer or portable archive of the stable version from [GitHub Release](https://github.com/QL-Win/QuickLook/releases)
* Using [Scoop](https://scoop.sh/): `scoop bucket add extras && scoop install extras/quicklook`
* Nightly builds from [AppVeyor](https://ci.appveyor.com/project/xupefei/quicklook/build/artifacts) and [GitHub Action](https://github.com/QL-Win/QuickLook/releases/)
* Nightly builds from [GitHub Action](https://github.com/QL-Win/QuickLook/releases/)
[What are the differences between `.msi`, `.zip`, Nightly and Store versions?](https://github.com/QL-Win/QuickLook/wiki/Differences-Between-Distributions)