QuickLook Text Viewer for multiple files types
TypeScript source files (.ts) collide with MPEG-2 transport-stream video,
which macOS binds to the .ts extension system-wide as
public.mpeg-2-transport-stream. Quick Look then routes the file to the
legacy /System/Library/QuickLook/Movie.qlgenerator, which claims the
parent type public.movie. That generator wins selection over our app
extension, fails to produce a preview for what is actually text, and Quick
Look does not fall through to other candidates — so the file shows the
generic "no preview" panel.
There is no clean third-party workaround:
- A third-party app cannot override the system's
.ts → public.mpeg-2-transport-streamUTI binding. We declare.tsin the host app'sUTExportedTypeDeclarations, butmdlsconfirms the file still resolves topublic.mpeg-2-transport-stream. - Declaring
public.mpeg-2-transport-streamin the extension'sQLSupportedContentTypesdoesn't help either — Movie.qlgenerator beats our app extension on the routing. - Disabling Movie.qlgenerator system-wide would require disabling SIP and would break Quick Look for genuine video files.
The relevant declarations are left in place (public.mpeg-2-transport-stream
in QLTextViewExtension/Info.plist, ts in the
UTExportedTypeDeclarations filename-extension list, and ts in
TextDetection.defaultExtensions) so that if Apple retires
Movie.qlgenerator — it has long been deprecated — .ts previews will
start working without a code change.
Files larger than 100 KB are previewed truncated, ending with a
[truncated — file exceeds 100 KB preview limit] notice. The cap is
TextDetection.defaultMaxBytes.