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

g2md 9年前發布 | 20K 次閱讀 JavaScript開發 JavaScript Browser

利用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

Favorites

附加功能

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

項目主頁:http://www.baiduhome.net/lib/view/home/1441163830612

 本文由用戶 g2md 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!