2015-07-05 09:24:36 +02:00
# Nativefier
2016-03-13 08:27:32 +01:00
2021-05-22 00:16:59 +02:00
![Example of Nativefier app in the macOS dock ](.github/dock-screenshot.png )
2015-07-06 07:44:49 +02:00
2016-03-10 19:27:49 +01:00
You want to make a native wrapper for WhatsApp Web (or any web page).
2016-01-19 15:02:01 +01:00
```bash
2021-04-28 00:12:02 +02:00
nativefier 'web.whatsapp.com'
2016-01-19 15:02:01 +01:00
```
2021-05-22 00:16:59 +02:00
![Walkthrough animation ](.github/nativefier-walkthrough.gif )
2016-03-27 05:36:04 +02:00
2016-01-19 15:02:01 +01:00
You're done.
2015-07-05 09:24:36 +02:00
2016-01-19 15:02:01 +01:00
## Introduction
2015-07-05 09:24:36 +02:00
2022-01-06 20:18:22 +01:00
Nativefier is a command-line tool to easily create a "desktop app" for any web site
with minimal fuss. Apps are wrapped by [Electron ](https://www.electronjs.org/ )
2020-07-18 16:19:58 +02:00
(which uses Chromium under the hood) in an OS executable (`.app`, `.exe` , etc)
2022-01-06 20:18:22 +01:00
usable on Windows, macOS and Linux.
2015-07-05 10:43:44 +02:00
2022-01-06 20:18:22 +01:00
I built this because I grew tired of having to `alt-tab` to my browser and then search
through numerous open tabs when using [Messenger ](https://messenger.com ) or
2020-07-18 16:19:58 +02:00
[Whatsapp Web ](https://web.whatsapp.com ) ([HN thread](https://news.ycombinator.com/item?id=10930718)). Nativefier features:
2016-01-29 18:57:30 +01:00
2022-01-06 20:18:22 +01:00
- Automatically retrieval of app icon / name
- Injection of custom JS & CSS
2021-05-22 00:16:59 +02:00
- Many more, see the [API docs ](API.md ) or `nativefier --help`
2016-01-29 04:37:54 +01:00
2015-07-05 09:24:36 +02:00
## Installation
2022-01-06 20:18:22 +01:00
Install Nativefier globally with `npm install -g nativefier` . Requirements:
2017-04-09 04:35:46 +02:00
- macOS 10.9+ / Windows / Linux
2022-01-06 20:18:22 +01:00
- [Node.js ](https://nodejs.org/ ) ≥ 12.9 and npm ≥ 6.9
Optional dependencies:
2016-01-22 05:31:30 +01:00
2022-01-06 20:18:22 +01:00
- [ImageMagick ](http://www.imagemagick.org/ ) or [GraphicsMagick ](http://www.graphicsmagick.org/ ) to convert icons.
Be sure `convert` + `identify` or `gm` are in your `$PATH` .
- [Wine ](https://www.winehq.org/ ) to build Windows apps from non-Windows platforms.
Be sure `wine` is in your `$PATH` .
2016-01-28 04:38:58 +01:00
2016-03-09 07:24:00 +01:00
## Usage
2016-01-28 04:38:58 +01:00
2020-07-18 16:19:58 +02:00
To create a native desktop app for [medium.com ](https://medium.com ),
2022-01-06 20:09:15 +01:00
simply `nativefier "medium.com"`
2016-01-28 04:38:58 +01:00
2020-07-18 16:27:56 +02: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'`
2016-03-09 07:24:00 +01:00
2021-05-22 00:16:59 +02:00
**Read the [API documentation ](API.md ) or run `nativefier --help` **
2020-07-18 16:27:56 +02:00
to learn about other command-line flags usable to configure the packaged app.
2016-01-18 18:17:27 +01:00
2020-07-18 16:19:58 +02:00
To have high-resolution icons used by default for an app/domain, please
2021-01-30 05:49:52 +01:00
contribute to the [icon repository ](https://github.com/nativefier/nativefier-icons )!
2016-01-18 18:17:27 +01:00
2022-01-06 20:09:15 +01:00
### Catalog
2021-05-03 19:08:32 +02:00
2022-01-06 20:09:15 +01:00
For a list of build commands contributed by the Nativefier community, see [CATALOG.md file ](CATALOG.md ).
2021-05-03 19:08:32 +02:00
2022-01-06 20:09:15 +01:00
## Docker
2020-08-11 03:33:32 +02:00
2022-01-06 20:09:15 +01:00
Nativefier is also usable from Docker:
- Pull the image from [Docker Hub ](https://hub.docker.com/r/nativefier/nativefier ): `docker pull nativefier/nativefier`
- ... or build it yourself: `docker build -t local/nativefier .`
2021-01-30 05:49:52 +01:00
(in this case, replace `nativefier/` in the below examples with `local/` )
2020-08-11 03:33:32 +02:00
2022-01-06 20:20:12 +01:00
By default, `nativefier --help` will be executed.
To build e.g. a Gmail app into `~/nativefier-apps` ,
2020-08-11 03:33:32 +02:00
```bash
2021-01-30 05:49:52 +01:00
docker run --rm -v ~/nativefier-apps:/target/ nativefier/nativefier https://mail.google.com/ /target/
2020-08-11 03:33:32 +02:00
```
2022-01-06 20:09:15 +01:00
You can pass Nativefier flags, and mount volumes to pass local files. E.g. to use an icon,
2020-08-11 03:33:32 +02:00
```bash
2021-01-30 05:49:52 +01: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/
2020-08-11 03:33:32 +02:00
```
2016-03-13 08:27:32 +01:00
## Development
2016-03-10 19:27:49 +01:00
2021-01-30 05:49:52 +01:00
Help welcome on [bugs ](https://github.com/nativefier/nativefier/issues?q=is%3Aopen+is%3Aissue+label%3Abug ) and
2022-01-06 20:09:15 +01:00
[feature requests ](https://github.com/nativefier/nativefier/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request )!
2017-05-19 15:21:16 +02:00
2022-01-06 20:18:22 +01:00
Docs: [Developer / build / hacking ](HACKING.md ), [API / flags ](API.md ),
2020-07-18 16:19:58 +02:00
[Changelog ](CHANGELOG.md ).
2017-05-19 15:21:16 +02:00
2016-03-10 19:27:49 +01:00
## License
2015-07-06 07:44:49 +02:00
2022-01-06 20:09:15 +01:00
[MIT ](LICENSE.md ).
2021-04-30 02:02:43 +02:00
## Troubleshooting
2022-01-06 20:09:15 +01:00
Generally, see [Catalog ](CATALOG.md ) for ideas & workarounds, and search in existing issues.
2021-05-03 19:08:32 +02:00
2022-01-06 20:09:15 +01:00
### Site says I use an old/unsupported browser
2021-04-30 02:02:43 +02:00
2022-01-06 20:09:15 +01:00
Some sites intentionally block Nativefier (or similar) apps, e.g. [Google ](https://github.com/nativefier/nativefier/issues/831 ) and [WhatsApp ](https://github.com/nativefier/nativefier/issues/1112 ).
2021-04-30 02:02:43 +02:00
2022-01-06 20:09:15 +01:00
First, try setting the [`--user-agent` ](https://github.com/nativefier/nativefier/blob/master/API.md#user-agent ) to `firefox` or `safari` .
2021-04-30 02:02:43 +02:00
2022-01-06 20:09:15 +01:00
If still broken, see [Catalog ](CATALOG.md ) for ideas & workarounds, and search in existing issues.
2021-04-30 02:02:43 +02:00
2022-01-06 20:09:15 +01:00
### Videos won't play
2021-04-30 02:02:43 +02:00
This issue comes up for certain sites like [HBO Max ](https://github.com/nativefier/nativefier/issues/1153 ) and [Udemy ](https://github.com/nativefier/nativefier/issues/1147 ).
2022-01-06 20:09:15 +01:00
First, try our [`--widevine` flag ](API.md#widevine ).
2021-04-30 02:02:43 +02:00
2022-01-06 20:09:15 +01:00
If still broken, see [Catalog ](CATALOG.md ) for ideas & workarounds, and search in existing issues.
2021-04-30 02:02:43 +02:00
2022-01-06 20:09:15 +01:00
### Settings cached between app rebuilds
2021-04-30 02:02:43 +02:00
This issue can occur because the cache of the app and the app itself are kept separate by default. You can try clearing out the cache.
2022-01-06 20:09:15 +01:00
Try delete your app's cache, which can be found in `<your_app_name_lower_case>-nativefier-<random_id>` in your OS's "App Data" directory (for Linux: `$XDG_CONFIG_HOME` or `~/.config` , for MacOS: `~/Library/Application Support/` , for Windows: `%APPDATA%` or `C:\Users\yourprofile\AppData\Roaming` )