2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 02:28:55 +00:00
nativefier/README.md

106 lines
4.1 KiB
Markdown
Raw Normal View History

2015-07-05 07:24:36 +00:00
# Nativefier
2016-03-13 07:27:32 +00:00
👋 dear users / contributors! Public service announcement!
2021-01-16 15:18:17 +00:00
Nativefier is maintained by YOU. It's reasonably sane to hack on nowadays,
it fits the use cases needed by the original author and the current maintainer,
so _we_ are not doing any active development.
2021-01-16 15:19:27 +00:00
But it's alive! It at least follows Electron releases with maintenance patches,
and if YOU use it and want to see juicy features & fixes, PR welcome!
2021-01-30 04:49:52 +00:00
Help welcome in particular on our [pinned issues](https://github.com/nativefier/nativefier/issues),
2021-01-16 15:18:17 +00:00
or any issue / feature that motivates you 🙂.
Thanks! Take care.
---
2021-01-30 04:49:52 +00:00
[![Build Status](https://github.com/nativefier/nativefier/workflows/ci/badge.svg)](https://github.com/nativefier/nativefier/actions?query=workflow%3Aci)
2016-03-10 18:27:49 +00:00
[![npm version](https://badge.fury.io/js/nativefier.svg)](https://www.npmjs.com/package/nativefier)
2020-03-15 21:57:22 +00:00
![Dock](docs/dock.png)
2015-07-06 05:44:49 +00:00
2016-03-10 18:27:49 +00:00
You want to make a native wrapper for WhatsApp Web (or any web page).
2016-01-19 14:02:01 +00:00
```bash
nativefier web.whatsapp.com
2016-01-19 14:02:01 +00:00
```
2020-03-15 21:57:22 +00:00
![Walkthrough animation](docs/walkthrough.gif)
2016-01-19 14:02:01 +00:00
You're done.
2015-07-05 07:24:36 +00:00
2016-01-19 14:02:01 +00:00
## Introduction
2015-07-05 07:24:36 +00:00
Nativefier is a command-line tool to easily create a desktop app for any web site
with minimal configuration. Apps are wrapped by [Electron](https://www.electronjs.org/)
(which uses Chromium under the hood) in an OS executable (`.app`, `.exe`, etc)
for use on Windows, macOS and Linux.
2015-07-05 08:43:44 +00:00
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](https://messenger.com) or
[Whatsapp Web](https://web.whatsapp.com) ([HN thread](https://news.ycombinator.com/item?id=10930718)). Nativefier features:
2016-01-29 17:57:30 +00:00
- Automatically retrieval of app icon / name.
- JavaScript and CSS injection.
- Many more, see the [API docs](docs/api.md) or `nativefier --help`
2015-07-05 07:24:36 +00:00
## Installation
2017-04-09 02:35:46 +00:00
- macOS 10.9+ / Windows / Linux
- [Node.js](https://nodejs.org/) `>= 10` and npm `>= 6`
Revamp and move to TypeScript (#898) ## Breaking changes - Require **Node >= 8.10.0 and npm 5.6.0** - Move to **Electron 8.1.1**. - That's it. Lots of care went into breaking CLI & programmatic behavior as little as possible. **Please report regressions**. - Known issue: build may fail behind a proxy. Get in touch if you use one: https://github.com/jiahaog/nativefier/issues/907#issuecomment-596144768 ## Changes summary Nativefier didn't get much love recently, to the point that it's becoming hard to run on recent Node, due to old dependencies. Also, some past practices now seem weird, as better expressible by modern JS/TS, discouraging contributions including mine. Addressing this, and one thing leading to another, came a bigger-than-expected revamp, aiming at making Nativefier more **lean, stable, future-proof, user-friendly and dev-friendly**, while **not changing the CLI/programmatic interfaces**. Highlights: - **Require Node>=8**, as imposed by many of our dependencies. Node 8 is twice LTS, and easily available even in conservative Linux distros. No reason not to demand it. - **Default to Electron 8**. - **Bump** all dependencies to latest version, including electron-packager. - **Move to TS**. TS is great. As of today, I see no reason not to use it, and fight interface bugs at runtime rather than at compile time. With that, get rid of everything Babel/Webpack. - **Move away from Gulp**. Gulp's selling point is perf via streaming, but for small builds like Nativefier, npm tasks are plenty good and less dependency bloat. Gulp was the driver for this PR: broken on Node 12, and I didn't feel like just upgrading and keeping it. - Add tons of **verbose logs** everywhere it makes sense, to have a fine & clear trace of the program flow. This will be helpful to debug user-reported issues, and already helped me fix a few bugs. - With better simple logging, get rid of the quirky and buggy progress bar based on package `progress`. Nice logging (minimal by default, the verbose logging mentioned above is only used when passing `--verbose`) is better and one less dependency. - **Dump `async` package**, a relic from old callback-hell early Node. Also dump a few other micro-packages unnecessary now. - A first pass of code **cleanup** thanks to modern JS/TS features: fixes, simplifications, jsdoc type annotations to types, etc. - **Remove GitHub integrations Hound & CodeClimate**, which are more exotic than good'ol'linters, and whose signal-to-noise ratio is too low. - Quality: **Add tests** and add **Windows + macOS CI builds**. Also, add a **manual test script**, helping to quickly verify the hard-to-programatically-test stuff before releases, and limit regressions. - **Fix a very small number of existing bugs**. The goal of this PR was *not* to fix bugs, but to get Nativefier in better shape to do so. Bugfixes will come later. Still, these got addressed: - Add common `Alt`+`Left`/`Right` for previous/next navigation. - Improve #379: fix zoom with `Ctrl` + numpad `+`/`-` - Fix pinch-to-zoom (see https://github.com/jiahaog/nativefier/issues/379#issuecomment-598612128 )
2020-03-15 20:50:01 +00:00
- Optional dependencies:
- [ImageMagick](http://www.imagemagick.org/) to convert icons.
Make sure `convert` and `identify` are in your system `$PATH`.
- [Wine](https://www.winehq.org/) to package Windows apps under non-Windows platforms.
2020-07-18 14:27:56 +00:00
Make sure `wine` is in your system `$PATH`.
2016-01-22 04:31:30 +00:00
Then, install Nativefier globally with `npm install -g nativefier`
2016-01-28 03:38:58 +00:00
## Usage
2016-01-28 03:38:58 +00:00
To create a native desktop app for [medium.com](https://medium.com),
simply `nativefier "medium.com"`
2016-01-28 03:38:58 +00:00
2020-07-18 14:27:56 +00:00
Nativefier will try to determine the app name, and well as lots of other options.
If desired, these options can be overwritten. For example, to override the name,
`nativefier --name 'My Medium App' 'medium.com'`
2020-07-18 14:27:56 +00:00
**Read the [API documentation](docs/api.md) or run `nativefier --help`**
to learn about other command-line flags usable to configure the packaged app.
2016-01-18 17:17:27 +00:00
To have high-resolution icons used by default for an app/domain, please
2021-01-30 04:49:52 +00:00
contribute to the [icon repository](https://github.com/nativefier/nativefier-icons)!
2016-01-18 17:17:27 +00:00
## Usage with Docker
Nativefier is also usable from Docker.
2021-01-30 04:49:52 +00:00
- Pull the latest stable image from Docker Hub: `docker pull nativefier/nativefier`
- ... or build the image yourself: `docker build -t local/nativefier .`
2021-01-30 04:49:52 +00:00
(in this case, replace `nativefier/` in the below examples with `local/`)
By default, the command `nativefier --help` will be executed.
To build e.g. a Gmail nativefier app to a writable local `~/nativefier-apps`,
```bash
2021-01-30 04:49:52 +00:00
docker run --rm -v ~/nativefier-apps:/target/ nativefier/nativefier https://mail.google.com/ /target/
```
You can pass Nativefier flags, and mount volumes to provide local files. For example, to use an icon,
```bash
2021-01-30 04:49:52 +00:00
docker run --rm -v ~/my-icons-folder/:/src -v $TARGET-PATH:/target nativefier/nativefier --icon /src/icon.png --name whatsApp -p linux -a x64 https://web.whatsapp.com/ /target/
```
2016-03-13 07:27:32 +00:00
## Development
2016-03-10 18:27:49 +00:00
2021-01-30 04:49:52 +00:00
Help welcome on [bugs](https://github.com/nativefier/nativefier/issues?q=is%3Aopen+is%3Aissue+label%3Abug) and
[feature requests](https://github.com/nativefier/nativefier/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request).
2020-07-18 14:27:56 +00:00
[Developer / build docs](docs/development.md), [API documentation](docs/api.md),
[Changelog](CHANGELOG.md).
2016-03-10 18:27:49 +00:00
## License
2015-07-06 05:44:49 +00:00
2016-03-13 07:27:32 +00:00
[MIT](LICENSE.md)