Changes to PWA manifest not applying - html

I'm having trouble applying updates made to Progressive Web App manifest. Updating stuff works otherwise just fine, but if I change something from my manifest, like background_color, the launch screen color will not change. I have monitored my server to see that manifest.json is indeed fetched. Restarting phone doesn't apply the changes either, the only way seems to be to uninstall the PWA and add back to home screen.
On desktop, chrome developer tools show that the manifest is correctly fetched and the changes can be seen in the dev tools. Is this expected behavior? Is there a way to make changes to manifest apply after the PWA has already been installed?

This has been addressed in the official The Web App Manifest docs:
Note: If you update your manifest.json file in the future, those
changes won't be automatically picked up by the users unless they
re-add your app to their home screen.
So, this is indeed the expected behavior.

Related

Apply changes to Web App Manifest on an installed PWA

If I want to make changes to my Progressive Web App, e.g. a slight change on the app name, or update the logo, is it possible to force an update on all my users' installed apps?
I tried adding "?v=2" to the manifest URL,
<link rel="manifest" href="/manifest.json?v=2" />
And also forced an update on the service worker.
However, it doesn't seem to apply the new changes on the installed app.
I tried this on Google Chrome on Android.
Forcing the update explicitly is not possible as per the spec. However, there's an ongoing discussion about it.
Are you completely sure your manifest.json wasn't served from the browser's cache? Or that the browser was actually served with the new HTML that referenced the renamed manifest.json?
My understanding was that you should just change the name (based on the content's hash, for instance) and let the browser do it's job. The spec says this way the browser should always request the new version. Not sure if the update should kick in immediately or before the next visit. However, I could be wrong.

How can I trigger an update of the manifest.json file in an installed progressive web app on Android? [duplicate]

If I want to make changes to my Progressive Web App, e.g. a slight change on the app name, or update the logo, is it possible to force an update on all my users' installed apps?
I tried adding "?v=2" to the manifest URL,
<link rel="manifest" href="/manifest.json?v=2" />
And also forced an update on the service worker.
However, it doesn't seem to apply the new changes on the installed app.
I tried this on Google Chrome on Android.
Forcing the update explicitly is not possible as per the spec. However, there's an ongoing discussion about it.
Are you completely sure your manifest.json wasn't served from the browser's cache? Or that the browser was actually served with the new HTML that referenced the renamed manifest.json?
My understanding was that you should just change the name (based on the content's hash, for instance) and let the browser do it's job. The spec says this way the browser should always request the new version. Not sure if the update should kick in immediately or before the next visit. However, I could be wrong.

Why is my Chrome Extension grayed out?

Problem
A chrome extension I wrote is grayed out, and I can't figure out why.
Context
I wrote and submitted a Chrome Extension called Pull Favors to the Chrome webstore.
It uses the CSS order property to sort and group GitHub Pull-Requests in a logical way.
The other day I noticed that several of my extensions were grayed out, and 'blocked'--meaning they no longer work. One of these was Pull Favors.
According to this support article:
If you see a message saying "Extensions Disabled," it's because Chrome has turned off one or more of your extensions to keep your data safe while you're browsing the Internet. The extensions that Chrome turned off either didn't come from the Chrome Web Store or were installed without your permission."
My extension is published in the Chrome webstore and was certainly installed with my permission.
I've tried uninstalling and reinstalling to no avail.
I suspect there's something wrong with my extension (since a few other extensions seem to still work), but I can't figure out what it is or find anything about it on the internet.
What's going on?
Research
Chrome seems to have implemented a new policy in November 2013, which has caused some uproar in the community, which prevents Windows users from installing extensions from outside the web store.
I'm not sure why this is affecting me, as I'm an OS X user and, as I said, my extension is distributed through the webstore.
Add browser_action.default_icon in your manifest.json file
{
...
"browser_action": {
"default_icon": "icons/icon-32.png"
},
...
}
Before
After
In one of the last couple updates, they did something weird with the extensions that now makes all enabled extensions show up in either the toolbar or in the menu. In your case, the extension icon is grayed out because you don't even use a browser action or a page action, so it is just showing the icon. So it isn't disabled, just doesn't have an active state so is grayed out.
A quick search doesn't seem to turn up a blog post about it, but if you right click on the icon you can hide it in the menu.

Chrome Extension: close background page after closing Chrome

I have an extension with a background page, and by default this causes Chrome to persist after you close all windows, and puts the Chrome icon in the system-tray. I would like to avoid this -- I do not want my extension to cause the Chrome process to persist after closing all Chrome windows, nor do I want to cause Chrome to appear in the systray.
According to the only docs I could find on this indicates that the user can set this option globally across all extensions, but that isn't what I'm trying to do. I'd like the extension to be unassuming / unobtrusive, and don't want to change the user's browser behavior. Does anyone know how to accomplish this while retaining the ability to have a background page?
UPDATE
With manifest version 2 you can now run event pages that are not persistent. Event pages are very similar to background pages but are only loaded when needed by the extension.
Example from the event pages doc on setting a non persistent event script in your manifest:
{
"name": "My extension",
...
"background": {
"scripts": ["eventPage.js"],
"persistent": false
},
...
}
Here is a tutorial on migrating your Chrome extension to manifest version 2.
OLD ANSWER
Currently, if your extension has a background defined in the manifest.json file, it will run before Chrome is launched and continue after all windows of Chrome are closed. That is unless the user changes their settings like you mentioned. There may be future versions of Google Chrome that allow for different functionality but you, the developer, won't be able to get around this issue at this time.
An excerpt from the background manifest docs
Makes Chrome start up early and and shut down late, so that apps and extensions can have a longer life.
When any installed hosted app, packaged app, or extension has "background" permission, Chrome runs (invisibly) as soon as the user logs into their computer—before the user launches Chrome. The "background" permission also makes Chrome continue running (even after its last window is closed) until the user explicitly quits Chrome.

Mobile Safari won't stop caching

I'm writing an offline app for mobile Safari.
I have just gotten to the point where it will create the app icon on the home screen and function offline.
Now I want to update the HTML in my app, but it refuses to refresh.
I've trIed the refresh button, the "clear cache" settings option, I have even taken down the server but safari still shows the page.
Help!
You need to modify the cache manifest. You can just add a comment line to the manifest. When you do, the browser will redownload the whole app.
More info about this topic can be found here: http://diveintohtml5.ep.io/offline.html#debugging
Your situation kind of applies to the title :)