Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Build Cross Platform Desktop Application with E...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
WM
October 04, 2015
Technology
900
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Build Cross Platform Desktop Application with Electron
@JSDC.TW 2015
WM
October 04, 2015
More Decks by WM
See All by WM
Fetch Web Streams
kidwm
0
280
Metaprogramming in ES2015
kidwm
3
990
Other Decks in Technology
See All in Technology
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
470
MySQL & MySQL HeatWave Report - June 2026
freshdaz
0
140
AIはどのように 組織のアジリティを変えるのか?
junki
4
1.4k
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
560
AI Agentをシステムに組み込む前にゆるく向き合ってみる
hayama17
0
150
AIAU_UMEMOGU_ninomiya_slide
ninomiya_ii
0
260
Multi-Agent並列開発を 安全に回すための技術 / Technology for Safely Multi-Agent Parallel Development
tooppoo
0
190
Deep Data Security 機能解説
oracle4engineer
PRO
2
120
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
210
2026 AI Memory Architecture
nagatsu
0
310
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
130
When Platform Engineering Meets GenAI
sucitw
0
180
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
270
How GitHub (no longer) Works
holman
316
150k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Design in an AI World
tapps
1
250
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Discover your Explorer Soul
emna__ayadi
2
1.1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
Transcript
Build Cross Platform Desktop Application with Electron @kidwm 1
Why to Build Desktop Application?
Desktop Factors • Massive Assets (Game) • Quick Typing (Messenger)
• Urgent Usage (Office) • Frequent Access (Music) Show Logo to your user constantly 3
How to Build Desktop Application?
How to Build Cross Platform Desktop Application?
Cross Platform Technology • Java • GTK+ / Qt •
XULRunner • Chrome Apps • Chromium Embedded Framework CEF everywhere! 6
CEF integrated with nodejs • brackets-shell • NW.js (node-webkit) •
Electron (atom-shell) Electron everywhere! 7
What is Electron?
History • Started in January 2013 • Built initially for
the Atom text editor • Renamed from atom-shell • use libchromiumcontent and Brightray to wrap Chromium Content module 9
browser process renderer process renderer renderer process process ipc
main.js var app = require('app') ; app.on('ready', function() {
electron-prebuilt sudo npm install --global electron-prebuilt electron main.js 12
Features
require modules built-in modules and npm packages modules for main
process and renderer process read module documentation 14
Inter-Process Communication
ipc • ipc.send(channel, args) • ipc.on(channel, callback) browser process renderer
process renderer renderer process process ipc 16
message channel app.js (renderer process) ipc.send ('connect', url); main.js (browser
process) ipc.on ('connect', function(event, url){}); 17
remote • remote.require(module) • remote.getCurrentWindow() • remote.getGlobal(name) browser process renderer
process renderer renderer process process ipc 18
remote procedure call main.js (browser process) global['config'] = JSON.parse(fs.readFileSync(path, 'utf8'));
app.js (renderer process) remote. getGlobal('config') ; 19
browserWindow & webContents • window.capturePage() • webContents.printToPDF() • webContents.enableDeviceEmulation() •
webContents.sendInputEvent() • webContents.executeJavaScript(code[, userGesture]) 20
webContents.session • session.cookies • session.enableNetworkEmulation() • session.setProxy() • session.clearStorageData() 21
<webview />
webview • preload script • disable websecurity • webview.openDevTools() •
webview.insertCSS() 23
shell
shell • shell.openExternal(url) • shell.openItem(fullPath) • shell.showItemInFolder(fullPath) • shell.moveItemToTrash(fullPath) 25
dialog
dialog • dialog.showOpenDialog() • dialog.showSaveDialog() • dialog.showMessageBox() remote.require('dialog'). showOpenDialog({
menu
menu template var Menu = remote.require('menu') ; var menu =
Menu.buildFromTemplate([{
contextmenu event window.addEventListener('contextmenu', function (e) {
tray
menubar 32
global-shortcut
auto-updater
Development Tips
Augmentation Add-on • Native Node Module • node-ffi • PPAPI
(Flash) 36
-webkit-user- drag: none;
window.process
electron- packager
asar
Pros • Latest nodejs and Chrome integration • Expose many
browser features • Actively Developing • Update with Upstream Quickly • Great Community Support 41
Cons • binary size is big⋯ • limited native system
features (still improving) • lack some browser features (eg. workers) but you have nodejs & npm! 42
Who uses Electron?
Kitematic
None
Slack
Caprine
nodeshot
Nightmare
Kaku
Mojibar
Plasmon
Plasmon • http://pcman.ptt.cc/ • Powered by pcman.js • currently focus
in Mac OSX • Welcome contribution 53
more on Awesome Electron
Thanks! @kidwm 55