Fix footer version, improve PDF filter detection
- options.html/js: Footer version now reads dynamically from manifest via api.runtime.getManifest().version instead of hardcoded v0.3.0 - document-scanner.js: Increase FlateDecode lookback from 200 to 500 bytes (real PDF stream dictionaries are often larger than 200 bytes), and support array form /Filter [/FlateDecode] alongside the scalar form https://claude.ai/code/session_01ReZUeR1nrYzJeX7fTqwXMw
This commit is contained in:
@@ -257,8 +257,8 @@ const DocumentScanner = {
|
||||
|
||||
// Try to decompress if FlateDecode
|
||||
let content = streamData;
|
||||
const filterMatch = str.slice(Math.max(0, match.index - 200), match.index)
|
||||
.match(/\/Filter\s*\/FlateDecode/);
|
||||
const dictSlice = str.slice(Math.max(0, match.index - 500), match.index);
|
||||
const filterMatch = dictSlice.match(/\/Filter\s*(?:\/FlateDecode|\[\/FlateDecode\]|\[.*?\/FlateDecode.*?\])/);
|
||||
|
||||
if (filterMatch) {
|
||||
try {
|
||||
|
||||
@@ -601,7 +601,7 @@
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p>Silent Send v0.3.0</p>
|
||||
<p id="footerVersion">Silent Send</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
$('#maxLogEntries').value = settings.maxLogEntries || 200;
|
||||
$('#browserSync').checked = settings.browserSync === true;
|
||||
|
||||
const { version } = api.runtime.getManifest();
|
||||
$('#footerVersion').textContent = `Silent Send v${version}`;
|
||||
|
||||
renderMappings();
|
||||
renderPasswords();
|
||||
renderDomains();
|
||||
|
||||
Reference in New Issue
Block a user