新增一个可以关闭"File content preview"显示的选项,因为有些大文件,软件会强制去显示他的内容,会导致软件直接卡死。
You should just remove the extension of the file type you do not want to be previewed from the settings, as shown in the following screenshot:
Deleting pdf (or any other type) in the Settings > File Types panel only lasts until the next launch. That’s probably because the app scans the viewer plug-ins and re-adds any extensions they support, so the pdf entry (and the content preview) reappear immediately.
After spending hours wrestling with extconfig.js
with no success, I tried a simpler fix: patch the pdf-viewer extension itself.
If you want to view the Details + Description of a file without the pdf preview (in the right panel), here’s what worked for me:
By the way, I have no experience with HTML. I used GPT o3 to generate a patch for the existing index.html
file.
How to disable TagSpaces’ built-in pdf content preview (macOS 15.1, Tagspaces pro 6.4.9)
-
Quit Tagspaces completely.
-
Install Homebrew (skip if you already have it).
-
In Terminal, run:
brew install node # gives you npm npm install -g asar # CLI (~30 kB) for unpacking Electron archives
-
Go to the folder
/Applications/TagSpaces.app/Contents/Resources
, you’ll find the fileapp.asar
. Unpack it so that Electron loads files fromapp/
instead of the packed archive:cd /Applications/TagSpaces.app/Contents/Resources asar extract app.asar app # creates an “app” folder next to app.asar
This generates an
app/
subfolder and some other files withinResources
. -
Navigate to the pdf-viewer’s
index.html
file. I found it in the following location./Applications/TagSpaces.app/Contents/Resources/app/node_modules/@tagspaces/extensions/pdf-viewer/index.html
-
Backup
index.html
so you can revert the changes later. -
Open
index.html
in TextEdit. The file content starts like this:<!DOCTYPE html> <html style="margin: 0; padding: 0; height: 100%"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <script src="../common/common.js"></script> <link rel="stylesheet" href="../libs/bootstrap5/bootstrap.min.css" /> <link rel="stylesheet" href="../common/common.css" /> ...
-
Within
index.html
, between the 3rd and 4th lines ( after<head>
and before<meta charset="utf-8" />
), paste the following block:<!-- ── Disable embedded PDF previews ───────────────────────── --> <script> /* Set MB_LIMIT to 0 to block every PDF, or to a size (in MB) above which previews are disabled. */ (() => { const MB_LIMIT = 0; // 0 ⇒ always disable try { const qs = new URLSearchParams(location.search); const file = decodeURIComponent(qs.get('file') || ''); if (MB_LIMIT === 0) { document.addEventListener('DOMContentLoaded', () => { document.body.innerHTML = '<div style="font:14px/1.4 -apple-system;padding:2rem">' + 'Preview disabled. Use “Open externally” if you need to view.' + '</div>'; }); window.stop(); // abort loading pdf.js and the rest of the page } } catch (e) { /* If anything fails, fall back to the normal viewer */ } })(); </script> <!-- ─────────────────────────────────────────────────────────── -->
-
This will impose a limit on the size of the pdf file before loading it for preview. You may set
MB_LIMIT
to a positive number if you’d like to preview small pdfs but skip large ones. -
Save the changes to
index.html
. -
Restart Tagspaces and click on a pdf. The preview pane in the right panel should now appear blank. It will show only Details + Description for the file.
Hope this saves someone else from a five-hour rabbit hole!