Total Pageviews

Thursday, 30 April 2020

Electron Sample Apps

This repository contains Electron sample apps to illustrate the usage of Electron APIs.
These sample apps are migrated from nw-sample-appschrome-app-sample and chromium extensions examples.
All samples are test on Electron v1.6.11.

How to run apps

  1. Install Electron via npm install -g electron.
  2. Run the sample via electron /.
If you want to know more about Electron app's development, please refer to the official docs.
------

Setup Electron on Ubuntu

Install nodejs on Ubuntu

# install node
$ apt-get install -y curl
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
$ sudo apt-get install -y nodejs

Install tape-run.

# install tape-run
npm i -g tape-run

Checking what’s missing

# checking missing dependencies
root@8aabd4ac0ce8:/# /usr/lib/node_modules/tape-run/node_modules/browser-run/node_modules/electron-stream/node_modules/electron-prebuilt/dist/electron --help
/usr/lib/node_modules/tape-run/node_modules/browser-run/node_modules/electron-stream/node_modules/electron-prebuilt/dist/electron: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

Install missing dependencies

# install missing dependencies
apt-get install -y libgtk2.0-0 libnotify-bin libgconf-2-4 libnss3 xvfb

Start xvfb server

# start xvfb server
export DISPLAY=':99.0'
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

Start tape-run

# start tape-run
$ root@8aabd4ac0ce8:/# echo "console.log('yo'); window.close()" | tape-run
yo
相关帖子:https://briteming.blogspot.com/2020/04/v2milk.html

No comments:

Post a Comment