PWAs Anywhere

Allow installing any webpage as a progressive web app

作者
octt
日安装量
1
总安装量
116
评分
1 0 0
版本
1.0.1
创建于
2024-03-24
更新于
2024-03-30
大小
3.2 KB
许可证
ISC
适用于
所有网站

This userscript live-patches any website that comes without a web app manifest, generating one automatically for your browser to detect, making it so that a good number of webpages can be forcefully installed as a progressive web app on your device. Mainly catered for Firefox mobile, but should work anywhere.

By default, the script will inject the generated manifest automatically on any webpage that doesn't provide its own. By using the options, usually accessible from your userscript manager's popup menu, you can either remove the current manifest, inject the dynamically generated one on a page that has its own (overriding it), or force reinjection of the custom manifest if that's for any reason needed.

Note that, for generating the manifest, the script relies on metadata already present on the site, as in the HTML page itself or well-known file paths. As per the PWA standard, the website must provide icons that are valid in both image format and resolution, otherwise issues may occur where either the page is installable as a PWA but will appear without an icon, or with a bad icon, or the browser will simply refuse to allow installation. I've seen that Chromium is more forgiving and will actually also install websites without icons, whereas Firefox is much more strict. I plan to implement dynamic icon generation in the future to automatically solve this problem for any site; in the meantime, you can use the option to force reinject a manifest, and a dialog prompt will appear, allowing you to provide an URL to any icon you want to use that you know should work.

Pro-tip: using this on Firefox and also want your forced-PWAs to work offline? Check out my Offline Caching add-on, it works seamlessly in conjunction with this userscript!