JavaScript Browser - 利用JavaScript實現的Web瀏覽器Windows App

利用JavaScript開發的一個Web瀏覽器 Windows app。這個項目是Windows 10中Web平臺的一個示例指南。這個瀏覽器是一個簡單App,基于HTML WebView control構建。主要使用JavaScript來點亮用戶界面。開發工具使用 Visual Studio 2015, 這是一個 JavaScript Universal Windows Platform (UWP) app.
除了使用 JavaScript之外,HTML和 CSS也是其使用的主要核心編程語言。Some C++ code is also included to enable supplemental features, but is not required to create a simple browser.
Additionally, we’re taking advantage of the new ECMAScript 2015 (ES2015) support in Chakra, the JavaScript engine behind Microsoft Edge and the WebView control. ES2015 allows us to remove much of the scaffolding and boilerplate code, simplifying our implementation significantly. The following ES2015 features were used in the creation of this app: Array.from(), Array.prototype.find(), arrow functions, method properties, const, for-of, let, Map, Object.assign(), Promises, property shorthands, Proxies, spread operator, String.prototype.includes(), String.prototype.startsWith(), Symbols, template strings, and Unicode code point escapes.
用戶界面
用戶界面包含了10個組件:
- Title bar
- Back button
- Forward button
- Refresh button
- Favicon
- Address bar
- Share on 推ter button
- Favorites button and menu
- Settings button and menu
- WebView control
附加功能
There are several additional features implemented to make the browsing experience more pleasant:
- Keyboard shortcuts - press F11 to toggle fullscreen mode, ESC to exit fullscreen mode, or Ctrl + L to select the address bar
- CSS transitions for animating the menus
- Cache management
- Favorites management
- URL input analysis — “bing.com” navigates to http(s)://bing.com, “seahawks” searches Bing
- Auto-de/select the address bar on blur/focus
- Responsive design