[Introduction] : A command-line tool that turns Web pages into native applications.

Introduction to the

Nativefier is a command-line tool that makes it easy to create desktop applications for any Web site with minimal configuration, turning Web pages into a command-line tool for native applications. The website is packaged with executables such as.app and.exe through Electron + Chromium, which supports running on Windows, MacOS and Linux operating systems.

For example, to make an executable file for WhatsApp Web, just run the following command:

nativefier 'web.whatsapp.com'

Project address is:

https://github.com/nativefier…

The installation

  • MacOS 10.9 + Windows + Linux
  • Node.js >= 12.9 and NPM >= 6.9
  • Optional dependence
    • Use ImageMagick or GraphicsMagick to transform the icon. Make sure CONVERT and IDENTIFY or GM are in the system PATH $PATH.
    • Wine packages Windows applications on non-Windows platforms. Make sure wine is in the system PATH $PATH.

Then, use the global install Nativefier:

npm install -g nativefier

usage

To create a native desktop application for Medium.com, simply execute the following command:

nativefier "medium.com"

Nativefier sets the application name and many other options by default. Users can override these options as well. For example, to override the name:

nativefier --name 'My Medium App' 'medium.com'

Common command line options are as follows:

-h, --help prints usage information -v, --version prints nativefier version -a, --arch <value> build target processor architecture, IA32, x64, ARMV7L, ARM64-C, -- Conceal Specifies whether the source code in the localized application is packaged together, The default is false -e, --electron-version <value> specifies the electron version -i, and --icon <path> specifies that the application icon must be the path to the.ico file when packaged for Windows. When you package Linux, it must be the path to the.png file. When you package MacOS, if you have an optional dependency installed, it must be an.icns or a.png file. If there is an image conversion tool (Iconutil, or Conver + Identify for ImageMagick, or GM for GraphicsMagick), Nativefier will automatically convert.png to.icns-n, --name <value> application name, used on Linux without Spaces --no-overwrite specifies whether the target directory should not be overwritten, Default: false -p, --platform <value> Default is the current operating system, can also be specified as Linux, Windows, OSX or MAS -- Portable lets an application store user data (cookies, cache, and so on) in an application folder --always-on-top application is kept at the top of the screen when started --background-color <string> specifies the background color, https://www.electronjs.org/docs/api/browser-window#setting-backgroundcolor - bookmarks - menu < string > define bookmarks menu JSON file path, Such as: {" menuLabel ":" & Music ", "bookmarks" : [{" title ":" lofi. Cafe ", "url" : "https://lofi.cafe/", "type" : "link", "shortcut": "CmdOrCtrl+1" }, { "title": "beats to relax/study to", "url": "https://www.youtube.com/watch?v=5qap5aO4i9A", "type": "link", "shortcut": "CmdOrCtrl+2" }, { "type": "Separator"}, {"title": "Rufus DU Sol Live from Joshua Tree", "type": "link", "url": "Https://www.youtube.com/watch?v=Zy4KtD98S2c"}}] - disable - the context menu to disable the context menu, disable - dev - tools to disable the Chrome developer tools -- Full-screen makes the packaged application start in full screen --height <value> Default: 800px -- Hide-window-frame disables window frames and controls --max-height <value> maximum height for applications, default: unlimited --max-width <value> maximum width for applications, Default unbounded --maximize startup of the packaged application --min-height <value> The minimum height for the packaged application, default is 0-m, --show-menu -- bar should display menu bar --single-instance, /* site.css */ /* Header is draggable... */ header { -webkit-app-region: drag; } /* but any buttons inside the header shouldn't be draggable */ header button { -webkit-app-region: no-drag; } /* perhaps move some items out of way for the traffic light */ header div:first-child { margin-left: 100px; margin-top: 25px; } --x <value> the x position of the packaged application window --y <value> the y position of the packaged application window --zoom <value> sets the default zoom factor to be used when the application is opened, the default is 1.0 --lang <value> setting language, "Fr", "en - US", "es"

Used with Docker

Nativefier can also be used in Docker.

  • Pull the latest stable image from Docker Hub:
docker pull nativefier/nativefier
  • Or build your own image:
docker build -t local/nativefier .
  • Using Docker to build native applications:
docker run --rm -v ~/nativefier-apps:/target/ local/nativefier https://mail.google.com/ /target/

Open source outpostDaily sharing of popular, interesting and useful open source projects. Participated in the maintenance of 100,000 + STAR open source technology resource library, including: Python, Java, C/C++, Go, JS, CSS, Node.js, PHP,.NET, etc.