Skip to content

Extract app pages and images from web app manifests - #807

Open
Shrashti1234 wants to merge 1 commit into
internetarchive:masterfrom
Shrashti1234:feat/web-app-manifests
Open

Shrashti1234 wants to merge 1 commit into
internetarchive:masterfrom
Shrashti1234:feat/web-app-manifests

Conversation

@Shrashti1234

Copy link
Copy Markdown

Implements core web app manifest extraction for #800.

Web app manifests currently fall through to generic string extraction. This can miss extensionless launch/icon URLs and treat descriptive strings such as example.com as crawl targets.

Add ExtractorWebManifest to extract start_url, icons[].src, screenshots[].src, shortcuts[].url, and shortcuts[].icons[].src. Resolve URLs against the fetched manifest, use navigation hops for app pages and embed hops for images, and honor the shared outlink limit. Ignore metadata/identity/scope fields, invalid member types, and non-HTTP(S) URLs. Malformed or non-object JSON remains available for fallback extraction.

Recognize the manifest MIME type, .webmanifest URLs, and resources discovered through <link rel="manifest">. Both HTML extractors now preserve that link context and classify manifests as embeds, allowing generic application/json manifests to work without claiming unrelated JSON documents. Wire the extractor before generic content extraction in both default XML and Groovy profiles, and document the supported fields and setup for existing jobs.

This branch is based directly on master and is independent of #805 and #806.

Validation (JDK 21):

mvn -B -pl docgen,commons,modules,engine -Dtest=ExtractorWebManifestTest,ExtractorHTMLTest,JerichoExtractorHTMLTest,ExtractorJsonTest,ProfileCrawlerBeansTest -Dsurefire.failIfNoSpecifiedTests=false test

96 tests passed: 94 extraction tests and 2 default-profile validation tests. Coverage includes HTML → JSON manifest → pages/images with both HTML parsers, correct relative URL resolution and hop types, extensionless resources, MIME/filename recognition, malformed JSON/member types, non-HTTP URLs, and the outlink limit.

Reference: W3C Web Application Manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant