久久久久久久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ò)攝像頭?)
主站蜘蛛池模板: 99精品网 | 亚洲免费三区 | 欧美日韩综合一区 | 亚洲高清视频一区二区 | 久久里面有精品 | 狠狠干美女 | 高清欧美性猛交xxxx黑人猛交 | 欧美一区二区在线视频 | 久久九九网站 | 日韩在线中文 | 久在线 | 中文字幕久久精品 | 国产色| a黄视频 | 国产三级 | av天天看| 日韩第一区 | 久久久精品网站 | 中文字幕一区二区三区四区五区 | 国产精品1区2区 | 亚洲免费视频播放 | 欧美激情第一区 | 色播av | 99免费精品视频 | 欧美日韩国产不卡 | 国产欧美一区二区三区在线看蜜臀 | 国产在线麻豆精品入口 | 国产在线观看av | 日韩在线视频一区 | av中文字幕在线播放 | 亚洲欧美日韩中文字幕一区二区三区 | 成人在线视频免费播放 | 日韩欧美不卡 | 一级电影免费看 | 一区二区三区国产精品 | 成人高清网站 | 国产伦精品一区二区三区照片91 | 久久天堂 | 亚洲最新在线视频 | 亚洲欧美在线观看视频 | 成人在线一区二区 |