久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Electron 將 Node.js 和 Chromium 上下文結(jié)合起來意味著

What does it mean for Electron to combine Node.js and Chromium contexts?(Electron 將 Node.js 和 Chromium 上下文結(jié)合起來意味著什么?)
本文介紹了Electron 將 Node.js 和 Chromium 上下文結(jié)合起來意味著什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

在一篇博文中,作者提到 Electron 將 Node 和 Chromium 組合成一個單一的context" 這意味著我們不必使用 Browserify 來轉(zhuǎn)換代碼.

In a blog post the author mentions that Electron combines Node and Chromium into a "single context" which implies that we don't have to use Browserify to transform code.

我知道 Electron 的一個含義是您可以使用 Web 技術(shù)構(gòu)建跨平臺的桌面應(yīng)用程序.我也理解我們能夠?qū)懭胛募到y(tǒng)的原因是因為 Electron 已經(jīng)嵌入了 Node.此外,我們能夠使用 HTML/CSS/JS/DevTools 的原因是因為 Chromium 被嵌入了.但是,我不要以為作者在說這個.

I understand that one implication of Electron is you can build cross-platform desktop apps using web technologies. I also understand the reason why we're able to write to the filesystem is because Electron has Node baked in. Also, the reason we're able to use HTML/CSS/JS/DevTools is because Chromium is baked in. However, I don't think this is what the author is talking about.

  • Electron 如何將 Node 和 Chromium 組合成一個單一上下文"?
  • 為什么不再需要使用 Browserify?

推薦答案

Chromium 是一個基于 Webkit 的 Web 瀏覽器,帶有 V8 javascript 引擎.它支持所有常用的瀏覽器和 DOM API,因此適合制作網(wǎng)頁,但不擅長與底層系統(tǒng)交互.

Chromium is a Webkit based web browser with the V8 javascript engine. It supports all the usual browser and DOM APIs and thus is good for making web pages and not good at interacting with the underlying system.

Node.js 是通過剝離 V8 引擎、制作無頭命令行應(yīng)用程序并添加廣泛的 API 來訪問文件系統(tǒng)而構(gòu)建的,require() 其他文件、運行其他 shell 程序等(您對真正的腳本語言的期望.

Node.js was built by striping out the V8 engine, making a headless command line application, and adding extensive APIs to access the file system, require() other files, run other shell programs, etc. (things you'd expect of a true scripting language.

Electron 以一種簡化的方式嘗試將 Chromium 中使用的 V8 引擎替換為新的更通用的 Node.js 引擎.它向 node.js 公開了一些額外的 API 以允許打開 chromium 窗口,但也允許使用 <script> 的每個 chromium 窗口標(biāo)記將使用 node.js 引擎對其進行解釋.

Electron in a simplified way is an attempt to replace the V8 engine used in Chromium with the new more general purpose oriented one of Node.js. It exposes a few extra APIs to node.js to allow for opening chromium windows, but also every chromium window using a <script> tag will interpret it with the node.js engine.

為什么選擇 Electron? Chromium 不能自己做到這一點的原因是因為它最初被設(shè)計為一個網(wǎng)絡(luò)瀏覽器,而在網(wǎng)絡(luò)瀏覽器中,文件系統(tǒng) API 將是聞所未聞的,因為通常文件是托管在遠程服務(wù)器上并訪問用戶計算機上的文件會帶來安全風(fēng)險(因為為什么任何單個網(wǎng)頁都可以訪問您的所有文件?).

Why Electron? The reason that Chromium can't do this by itself is because it was originally designed to be a web browser and in web browsers file system APIs would be unheard of as typically files are hosted on a remote server and accessing files on a user's computer would be a security risk (because why should any single webpage have access to all your files?).

require 語句現(xiàn)在可以開箱即用,因為 node.js 具有文件系統(tǒng)支持將允許它們從磁盤同步讀取,而無需將它們捆綁到同一個 javascript 文件或從服務(wù)器.

require statements now work out of the box because node.js has filesystem support will allows them to be synchronously read from the disk without the need for bundling them into the same javascript file or requesting them from a server.

這篇關(guān)于Electron 將 Node.js 和 Chromium 上下文結(jié)合起來意味著什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器進程中創(chuàng)建子窗口時如何修復(fù) BrowserWindow 不是構(gòu)造函數(shù)錯誤) - IT屋-程序員軟件開發(fā)技術(shù)
mainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 應(yīng)用程序上顯示白屏)
Electron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:無法在第二個 loadURL 上執(zhí)行腳本)
how to use electron browser window inside components in angular-cli?(如何在angular-cli的組件內(nèi)使用電子瀏覽器窗口?)
ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之間共享 redux 存儲?)
How to access camera/webcamera inside electron app?(如何在電子應(yīng)用程序中訪問相機/網(wǎng)絡(luò)攝像頭?)
主站蜘蛛池模板: 最近中文字幕免费 | 免费亚洲视频 | 中文字幕免费在线 | 黄色片免费 | 亚洲中国字幕 | 中文字幕在线一区二区三区 | 日日操日日干 | 亚洲第一色站 | 国产一区二区影院 | 国产精品久久久久久久免费大片 | 亚洲精品视频三区 | 成人亚洲精品久久久久软件 | 国产成人午夜精品影院游乐网 | 中文字幕在线观看第一页 | 久久精彩| 综合久久一区 | 欧美在线一区二区三区 | 国产成人福利在线观看 | 精品视频www | 美女视频h| 亚洲国产精品91 | 日本一区二区三区视频在线 | 午夜理伦三级理论三级在线观看 | 国产黄色麻豆视频 | 精品乱码一区二区三四区 | 欧美精品三区 | 国产精品久久久久久久久久尿 | 精品久久国产 | 成人久久久 | 国产欧美一区二区精品忘忧草 | av在线伊人 | 久久精品电影 | 91亚洲精品国偷拍自产在线观看 | 亚洲一区二区视频 | 美女视频三区 | 欧美日韩在线成人 | 一区二区日韩 | 欧美寡妇偷汉性猛交 | 中文字幕一区在线 | 国产精品欧美一区二区 | 欧美一区在线视频 |