-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site installation errors in WP admin #222
Comments
Interesting. It's true the manifest is not being added to the admin. That could be fixed via: diff --git a/wp-includes/class-wp-web-app-manifest.php b/wp-includes/class-wp-web-app-manifest.php
index bb3ac62..5c0d11e 100644
--- a/wp-includes/class-wp-web-app-manifest.php
+++ b/wp-includes/class-wp-web-app-manifest.php
@@ -60,6 +60,7 @@ class WP_Web_App_Manifest {
*/
public function init() {
add_action( 'wp_head', array( $this, 'manifest_link_and_meta' ) );
+ add_action( 'admin_head', array( $this, 'manifest_link_and_meta' ) );
add_action( 'rest_api_init', array( $this, 'register_manifest_rest_route' ) );
add_filter( 'site_status_tests', array( $this, 'add_short_name_site_status_test' ) );
} But since the admin and the frontend have different service workers with different scopes, and since the admin and frontend can be on different domains entirely, perhaps the admin manifest should have a |
Offline usage and Add to Homescreen don't really make sense for admin IMO. Offline usage especially won't work because no forms will be able to process and saved nonces will be invalid anyways. The other PWA features could potentially be useful in admin context, though. I think the main case where the same service worker would be desired in both admin and frontend contexts would potentially be for push notifications? There may be other service worker use-cases I'm not familiar with. |
Eventually service workers will unlock the ability to author and edit posts while being completely offline: #47 When that happens, being able to install the admin to the homescreen would be more useful. |
Great feature! Looking forward to that; I think it'll be super useful for writers! |
Proposed in #295. |
On every WP admin page I see an error in the console log that the site can't be installed because it has no
link
to the manifest. It's not really causing any issues, and technically it's correct (there is no manifest link in the admin), but it seems weird that it's trying to make site installation available on the site admin. I think either adding the manifest link in the admin header or disabling site installation in the admin would solve the issue nicely.The text was updated successfully, but these errors were encountered: