在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ 什么是`LS`, 什么是Electron呢?

什么是`LS`, 什么是Electron呢?

我在看代碼的時(shí)候:

// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  if (!r && typeof process !== 'undefined' && 'env' in process) {
    r = process.env.DEBUG;
  }

這句話怎么理解?

If debug isn't set in LS, and we're in Electron

什么是LS, 什么是Electron呢?

回答
編輯回答
野橘

electron官方描述是“Electron 基于 Chromium 和 Node.js, 讓你可以使用 HTML, CSS 和 JavaScript 構(gòu)建應(yīng)用?!?/strong>也就是用前端技術(shù)寫(xiě)桌面程序,比如vscode。
最簡(jiǎn)單的,你寫(xiě)幾個(gè)html頁(yè)面然后用Electron打包就可以得到一個(gè)桌面應(yīng)用程序。 不過(guò)使用Electron的話最好先了解部分nodejs知識(shí),不然還不如用瀏覽器打開(kāi)html。

LS你看下上下文。。。你這是debug.js的源碼,這里的LS指的是localstorage。

 function load() {
   var r;
   try {
    //給r賦值exports.storage.debug,exports.storage在代碼開(kāi)始幾行定義
     r = exports.storage.debug;
   } catch(e) {}
  exports.storage = 'undefined' != typeof chrome
                 && 'undefined' != typeof chrome.storage
                    ? chrome.storage.local
                    : localstorage();

processmodule.export這些都是和nodejs有關(guān)的概念,你如果不了解nodejs的話不建議你看這源碼。

2017年2月4日 19:11