最低要求
如果您是網頁開發者且有網站或網頁程式、您想做成可安裝的 Open Web app的話,以下所列是您所需要做的事情,且技術成分很低。最低限度要求很少:
- 建立一份 app manifest.
- 提供一份 app manifest、且附檔名存為
.webapp
。將Content-Type
的 header 設成application/x-web-app-manifest+json
。 - 發佈 app、可以放在自己的網站上或是 app store (當然也可以都放)。要自己發佈的話,需要在使用者的瀏覽器裡 針對您的網站加上一些程式碼以安裝及更新 app。
選擇性的功能
Philosophically, the idea of an installable Open Web app is much more than simply adding a manifest to your site. Web standards technologies can be viewed as a full-blown application platform that happens to use a browser engine for rendering user interfaces and interpreting code, and happens to use Web protocols for communicating with a server. Mozilla offers "Web runtime" executables for various platforms so that apps can run in their own window, without a browser window frame.
To "appify" a website, there are many application-specific questions to consider:
- Should my app work when not connected to the Web?
- How does my app use data, and how does it need to be stored?
- Can my app's performance benefit from advanced platform features like Web Workers or WebSockets?
- And many more
If you want to take full advantage of the capabilities of installable apps, there is plenty that you can do. For example:
- Use responsive Web design to look good and work well on all devices.
- Charge money for apps.
- Provide a way to identify users.
- Enable offline caching so the app can be used when the device is not on the Internet.
- Store data locally using either IndexedDB or localStorage.
- Launch the app natively (with an icon on the desktop or the home screen).
- Use device APIs to interact with hardware, such as geolocation and orientation.
- Give users a way to give you feedback. Mozilla's user research shows that users want to give feedback to app developers, and want to know that there is a human receiving it. They want to make suggestions and get help with problems. They may stop using an app if they have a problem and there is no way to get help with it.
Useful technologies
Here are some Web technologies that may be useful in writing installable apps. Notice that there is nothing on this list that is unique to Open Web apps!