- Progressive Web Application Development by Example
- Chris Love
- 713字
- 2021-08-05 10:33:22
Microsoft Edge and Internet Explorer
When Windows 8 shipped, Microsoft quietly shipped support for what they called a Hosted Web App (HWA). These are websites that reference a valid web manifest file and are served via HTTPS.
HWAs were an early precursor to progressive web apps. The obvious difference is no service worker requirement, which you would expect since the concept of a service worker had not be created yet.
To be a HWA, you would create a .appx file for your application containing the manifest file and a reference to the public URL. Then, you would submit the HWA appx to the Windows Store and consumers could install the HWA from the store.
The advantage of being a HWA is that these web apps have full access to all the Windows platform APIs, just like any native application. The reason that they have this privilege is that once installed, they form the store and are full blown applications.
The main difference is that the UI components and business logic are all just web pages. This gives you the benefit of also being able to update the application immediately, without going through the audit delays that plague all mobile app stores.
In many ways, this is a cross between a traditional native app and the WebAPK functionality supported by Chrome on Android.
Microsoft even created an online tool called Manifoldjs to help with the HWA creation and submission process. In recent years, Manifold has been remodeled and has a new name, PWA Builder (https://pwabuilder.com).
Today, PWA Builder takes any public website and provides the resources to convert it into a Progressive Web Application and submit it not only to the Windows Store, but also compile Cordova apps for the Apple and Google Play stores.
If you are wondering, there are many HWA and PWAs already in the Windows Store. Twitter and Pandora are a pair of high profile Windows progressive web apps. In fact, Twitter is in the process of deprecating all their native apps to PWA in the future.
I will go into more detail about PWA Builder in Chapter 10, Service Worker Tools. Trust me, you will not want to skip this chapter, as PWA Builder and the other tools we have mentioned have all become staples of my PWA workflow.
Today, Microsoft Edge supports service workers, which means that the concept of HWA has evolved into the consumption of progressive web apps. The same process applies to store submission and you still have full, native application capabilities.
Windows 8 and Internet Explorer also support native Live Tiles for web applications pinned to the start screen. When Edge and Windows 10 were released, Live Tile support did not make the cut. This does not mean you cannot add websites to the start menu, though.
In Microsoft Edge, the user can open the menu via the ... icon in the top right corner. This exposes a menu of many options, one being pin this page to Start. Another option is to add the page to the taskbar:
As you may recall, Internet Explorer supported a rich pinned site feature in the Windows 7 era. Recently, support for the pinned sites has returned. Like iOS, you can customize this experience via meta tags:
<meta name="application-name" content="2048" /> <meta name="msapplication-square70x70logo" content="meta/2048-logo-70x70.png" /> <meta name="msapplication-square150x150logo" content="meta/2048-logo-152x152.png" /> <meta name="msapplication-wide310x150logo" content="meta/2048-logo-310x150.png" /> <meta name="msapplication-square310x310logo" content="meta/2048-logo-310x310.png" /> <meta name="msapplication-TileColor" content="#ECC400" />
Pinned sites still work from Internet Explorer, but as enterprises upgrade to Windows 10, the use of Internet Explorer as a primary browser is quickly fading. This does not mean you should skip the pinned site meta data. I still include it, for now.
I don't want to put these solutions in a negative space because they are both good first attempts to advance the web platform to give users a better user experience. Maybe you can see how these attempts have served as a reference for the modern web manifest specification.
Now that Microsoft Edge has shipped service workers, the team is busy working on what their add to start menu (my term, not theirs) will look like. They provided some early protypes at the 2018 Build conference, but at the time of writing this book, there is nothing definitive.
My best guess is that some time in the late summer or early fall we may see something more concrete from Redmond at their annual Edge Developer Summit.