PDA

View Full Version : nativefier



Nimbi
December 11th, 2019, 03:53 AM
This is the tool I use when making the desktop applications I share.
I've discontinued most of my desktop applications to reduce the amount I need to keep updated, but if you would like to make your own just use this tool.

Nativefier

https://camo.githubusercontent.com/aca9896a641ca2a51a44334453356eaa35eed924/68747470733a2f2f7472617669732d63692e6f72672f6a696168616f672f6e6174697665666965722e7376673f6272616e63683d646576656c6f706d656e74 (https://travis-ci.org/jiahaog/nativefier) https://camo.githubusercontent.com/b894cd6636424ab991390a8c43facbc8ed4e00c7/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a696168616f672f6e6174697665666965722f6261646765732f6770612e737667 (https://codeclimate.com/github/jiahaog/nativefier) https://camo.githubusercontent.com/738dc95632651a1cc6744eae10d51799e2e6a985/68747470733a2f2f62616467652e667572792e696f2f6a732f6e6174697665666965722e737667 (https://www.npmjs.com/package/nativefier) https://camo.githubusercontent.com/cab3494a814b019369b9986234e8df75ad41b3be/68747470733a2f2f64617669642d646d2e6f72672f6a696168616f672f6e6174697665666965722e737667 (https://david-dm.org/jiahaog/nativefier)
https://raw.githubusercontent.com/jiahaog/nativefier/master/docs/dock.png



You want to make a native wrapper for WhatsApp Web (or any web page).
`nativefier web.whatsapp.com`
https://github.com/jiahaog/nativefier/raw/master/screenshots/walkthrough.gif (https://github.com/jiahaog/nativefier/blob/master/screenshots/walkthrough.gif)
You're done.
https://github.com/jiahaog/nativefier/raw/master/docs/walkthrough.gif
Table of Contents



Installation (https://github.com/jiahaog/nativefier#installation)
Usage (https://github.com/jiahaog/nativefier#usage)
Optional dependencies (https://github.com/jiahaog/nativefier#optional-dependencies)
How it works (https://github.com/jiahaog/nativefier#how-it-works)
Development (https://github.com/jiahaog/nativefier/blob/master/docs/development.md)
License (https://github.com/jiahaog/nativefier#license)


(https://github.com/jiahaog/nativefier#introduction)Introduction

Nativefier is a command-line tool to easily create a desktop application for any web site with succinct and minimal configuration. Apps are wrapped by Electron (http://electron.atom.io/) in an OS executable (.app, .exe, etc.) for use on Windows, macOS and Linux.
I did this because I was tired of having to ⌘-tab or alt-tab to my browser and then search through the numerous open tabs when I was using Facebook Messenger (http://messenger.com/) or Whatsapp Web (http://web.whatsapp.com/) (relevant Hacker News thread (https://news.ycombinator.com/item?id=10930718)).
Changelog (https://github.com/jiahaog/nativefier/blob/master/docs/changelog.md). Developer docs (https://github.com/jiahaog/nativefier/blob/master/docs/development.md).

(https://github.com/jiahaog/nativefier#features)Features



Automatically retrieves the correct icon and app name.
JavaScript and CSS injection.
Flash Support (with --flash (https://github.com/jiahaog/nativefier/blob/master/docs/api.md#flash) flag).
Many more, see the API docs (https://github.com/jiahaog/nativefier/blob/master/docs/api.md) or nativefier --help


(https://github.com/jiahaog/nativefier#installation)Installation


(https://github.com/jiahaog/nativefier#requirements)
Requirements



macOS 10.9+ / Windows / Linux
Node.js (https://nodejs.org/) >=6 (4.x may work but is no longer tested, please upgrade)
See optional dependencies (https://github.com/jiahaog/nativefier#optional-dependencies) for more.

npm install nativefier -g

(https://github.com/jiahaog/nativefier#usage)Usage

Creating a native desktop app for medium.com (http://medium.com/):
nativefier "http://medium.com"
Nativefier will intelligently attempt to determine the app name, your OS and processor architecture, among other options. If desired, the app name or other options can be overwritten by specifying the --name "Medium" as part of the command line options:
nativefier --name "Some Awesome App" "http://medium.com"
Read the API documentation (https://github.com/jiahaog/nativefier/blob/master/docs/api.md) (or nativefier --help) for other command line flags and options that can be used to configure the packaged app.
If you would like high resolution icons to be used, please contribute to the icon repository (https://github.com/jiahaog/nativefier-icons)!
Windows Users: Take note that the application menu is automatically hidden by default, you can press alt on your keyboard to access it.
Linux Users: Do not put spaces if you define the app name yourself with --name, as this will cause problems when pinning a packaged app to the launcher.

(https://github.com/jiahaog/nativefier#optional-dependencies)Optional dependencies


(https://github.com/jiahaog/nativefier#icons-for-windows-apps-packaged-under-non-windows-platforms)Icons for Windows apps packaged under non-Windows platforms

You need Wine (https://www.winehq.org/) installed; make sure that wine is in your $PATH.

(https://github.com/jiahaog/nativefier#icon-conversion-for-macos)Icon conversion for macOS


To support conversion of a .png or .ico into a .icns for a packaged macOS app icon (currently only supported on macOS), you need the following dependencies.


iconutil (https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html) (comes with Xcode (https://developer.apple.com/xcode/)).
imagemagick (http://www.imagemagick.org/script/index.php). Make sure convert and identify are in your $PATH.
If the tools are not found, then Nativefier will fall back to the built-in macOS tool sips to perform the conversion, which is more limited.


(https://github.com/jiahaog/nativefier#flash)
Flash

Google Chrome (https://www.google.com/chrome/) is required for flash to be supported; you should pass the path to its embedded Flash plugin to the --flash flag. See the API docs (https://github.com/jiahaog/nativefier/blob/master/docs/api.md) for more details.

(https://github.com/jiahaog/nativefier#how-it-works)How it works

A template app with the appropriate plumbing is included in the ./app folder. When nativefier is run, this template is parameterized, and packaged using Electron Packager (https://github.com/electron-userland/electron-packager).
In addition, I built GitCloud (https://github.com/jiahaog/gitcloud) to use GitHub as an icon index, and also the pageIcon (https://github.com/jiahaog/page-icon) fallback to infer a relevant icon from a URL.

(https://github.com/jiahaog/nativefier#development)Development

Help welcome on bugs (https://github.com/jiahaog/nativefier/issues?q=is%3Aissue+label%3Abug) and feature requests (https://github.com/jiahaog/nativefier/issues?q=is%3Aissue+label%3A%22feature+request%22)!
Get started with our docs: Development (https://github.com/jiahaog/nativefier/blob/master/docs/development.md), API (https://github.com/jiahaog/nativefier/blob/master/docs/api.md).

(https://github.com/jiahaog/nativefier#docker-image)Docker Image

The Dockerfile (https://github.com/jiahaog/nativefier/blob/master/Dockerfile) is designed to be used like the "normal" nativefier app. By default, the command nativefier --help will be executed. Before you can use the image, you have to build it:
docker build -t local/nativefier .
After that, you can build your first nativefier app to the local $TARGET-PATH. Ensure you have write access to the $TARGET-PATH:
docker run -v $TARGET-PATH:/target local/nativefier https://my-web-app.com/ /target/
You can also pass nativefier flags, and mount additional volumes to provide local files. For example, to use a icon:
docker run -v $PATH_TO_ICON/:/src -v $TARGET-PATH:/target local/nativefier --icon /src/icon.png --name whatsApp -p linux -a x64 https://my-web-app.com/ /target/

(https://github.com/jiahaog/nativefier#license)License

MIT (https://github.com/jiahaog/nativefier/blob/master/LICENSE.md)



Github Repository

https://github.com/jiahaog/nativefier



Credits

jiahaog (https://github.com/jiahaog)