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 {
|
||||
|
||||
Reference in New Issue
Block a user