Add mobile web app support (Add to Home Screen)#91
Open
Conversation
Enable Press This to work as a standalone mobile web app via Add to Home Screen on Android and iOS. Adds Web App Manifest with Share Target API support, app icons, mobile web app meta tags, and standalone mode UI handling. Closes #2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Progressive Web App (Add to Home Screen) support for Press This, including a web app manifest endpoint and UI behavior tweaks for standalone display mode.
Changes:
- Serve a Web App Manifest via a new public REST endpoint, including Share Target support.
- Add standalone-mode behavior adjustments (redirect behavior + menu items).
- Add mobile web app meta tags and icon/manifest links in the Press This HTML head.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/PressThisEditor.js | Detects standalone mode to adjust redirect behavior. |
| src/components/Header.js | Adds standalone-only menu items and standalone detection. |
| press-this-plugin.php | Registers a new REST route and returns the manifest JSON. |
| includes/class-press-this-assets.php | Syncs script dependencies by adding wp-keyboard-shortcuts. |
| class-wp-press-this-plugin.php | Injects mobile web app meta tags and manifest/icon links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Set Content-Type to application/manifest+json per W3C spec. Localize the app name in both the manifest endpoint and the apple-mobile-web-app-title meta tag for translation support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables Press This to work as a standalone mobile web app that can be added to the home screen on Android and iOS. Implements the core features from #2 (originally WordPress core Trac #33195).
/press-this/v1/manifest) with Share Target API support (Android)mobile-web-app-capable,apple-mobile-web-app-capable,theme-color, etc.)window.close()in redirects, add "View Site" and "New Post" menu itemsShare Target
The manifest
share_targetreuses Press This's existing GET params (?u=...&t=...), so sharing a URL from another Android app opens Press This with the URL pre-filled — no editor changes needed.Future enhancements
These are out of scope for this PR but documented for future work:
apple-touch-startup-imagetags per device resolutionPOST+multipart/form-dataTest plan
<head>/wp-json/press-this/v1/manifest— confirm valid JSON with correct dynamic URLswindow.close()