node-webkit 案頭開發 初入1

來源:互聯網
上載者:User

標籤:des   blog   http   io   ar   os   使用   sp   java   

node-webkit  是什麼就不介紹了

注意官網的一句話 ”node-webkit is based on Chromium and node.js " 所以node-webkit 實際是嵌套了個Chromium 瀏覽器 ,而不是webkit核心。

 

1前端目錄,配置 package.json

{    "main": "main.html",                              /* APP的主入口,檔案名稱任意;必選 */    "name": "demo",                                /* APP的名稱,必須具備唯一性,且符合正常變數命名;必選 */    "description": "demo app of node-webkit",         /* APP的簡單描述 */    "version": "0.1.0",                               /* APP的版本號碼 */    "keywords": [ "demo", "node-webkit" ],            /* APP的關鍵字,搜尋APP時用到 */    "window": {                                       /* APP的視窗屬性 */        "icon": "link.png",                           /* APP表徵圖(windows下,狀態列上可見) */        "toolbar": false,                              /* 是否顯示工具列 */        "width": 800,                                 /* 視窗初始化大小 */        "height": 500,        "frame": true                               /* 是否顯示外表單,如最大化、最小化、關閉按鈕 */    },    "user-agent": "%name %ver %nwver %webkit_ver %osinfo" /* 可自訂APP的UA */}

2開發調試,直接將 前端目錄 拖到nw.exe 上就可以了

3 打包

要注意的是即使 在node-webkit  10.5  修複了,跳轉頁面時不清理記憶體造成應用崩潰的問題,但是不能直接使用網路地址配置成app的入口檔案("main": "http://localhost:8882/app/marketing/index.html#/view/marketActivity",),

這樣切換時也會經常出現應用崩潰。 

入口檔案必須是個本地檔案    "main": "index.html",再在index.html 做location.href  的跳轉。

node-webkit 案頭開發 初入1

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.