1
0
mirror of https://github.com/jiahaog/Nativefier synced 2024-06-29 08:00:47 +02:00
Commit Graph

17 Commits

Author SHA1 Message Date
Adrian DC
310d63e397 Support packaging nativefier applications into Squirrel-based installers (#744)
[Squirrel](https://github.com/Squirrel/Squirrel.Windows) is *"an installation and update
framework for Windows desktop apps "*.

This PR adds `electron-squirrel-startup`, allowing to package nativefier applications 
into squirrel-based setup installers. Squirrel require this entrypoint to perform
desktop and startup menu creations, without showing the UI on setup launches.

- References: https://github.com/mongodb-js/electron-squirrel-startup

- Resolves `electron-winstaller` and `electron-installer-windows` support of desktop / startup menu shortcuts for nativefier packaged applications.

- The `electron-squirrel-startup` entrypoint has no effect on both Linux and Darwin, only on Windows

- Supporting it directly inside `nativefier` avoids having to "hack" around the existing `main.js`
  and including dependencies from `electron-squirrel-startup` in an intermediate package
  to be included in a third layer for the final installer executable

- The following script based on both `nativefier` and `electron-winstaller` templates
   represents a portable proof of concept for this merge request :

```js
var nativefier = require('nativefier').default;
var electronInstaller = require('electron-winstaller');

var options = {
  name: 'Web WhatsApp',
  targetUrl: 'http://web.whatsapp.com',
  platform: 'windows',
  arch: 'x64',
  version: '0.36.4',
  out: '.',
  overwrite: false,
  asar: false,
  counter: false,
  bounce: false,
  width: 1280,
  height: 800,
  showMenuBar: false,
  fastQuit: false,
  userAgent: 'Mozilla ...',
  ignoreCertificate: false,
  ignoreGpuBlacklist: false,
  enableEs3Apis: false,
  insecure: false,
  honest: false,
  zoom: 1.0,
  singleInstance: false,
  fileDownloadOptions: {
    saveAs: true
  },
  processEnvs: {
    GOOGLE_API_KEY: '<your-google-api-key>'
  }
};

nativefier(options, function(error, appPath) {
  if (error) {
    console.error(error);
    return;
  }
  console.log('App has been nativefied to', appPath);

  resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: 'Web WhatsApp-win32-x64',
    outputDirectory: './',
    authors: 'Web WhatsApp',
    exe: 'Web WhatsApp.exe'
  });

  resultPromise.then(() => console.log('It worked!'), e => console.log(`No dice: ${e.message}`));
});
```
2019-02-08 09:57:32 -05:00
Ronan Jouchet
bbef14ccc6 Bump default Electron to 2.0.5, upgrade deps 2018-07-21 08:58:53 -04:00
David Kramer
ec1023d7ef Fix #95, #384 - Use electron-context-menu, supporting cut/copy/paste (PR #588)
The electron-context-menu package uses the context-menu event emitted by WebContents (API added in Electron 1.0.2) to add a general context menu supporting generic actions (e.g. cut/copy/paste) that can be customized. This change replaces the existing context menu, which relies on adding an event listener in preload.js, with one built using the new package.
2018-04-22 19:48:56 -04:00
Matt Harris
eb08d85830 Fix #480 - Move all console.* to loglevel.* calls, eslint-fail on console.* (PR #507) 2017-12-19 08:42:06 -05:00
Ronan Jouchet
6fb3b92eb8
Upgrade dependencies and default to latest Electron 1.7.9 (PR #483)
* Update deps except eslint
* Update eslint and lint:fix (WIP, needs manual fixing for remaining 44 problems)
* Manually fix remaining eslint errors
* Document deprecation of `version-string` as of electron-packager 9.0.0
* Upgrade to Electron 1.7.9 (chrome-58, node-7.9.0, v8-5.8)
* npm: Disable generation of package-lock.json and gitignore it
  --Trying this, package-lock is a pain in PRs. May not be a good idea
  (obviously we lose deps pinning), will revert if necessary.--
* npm tasks: add dev-up-win for Windows developers,
  and e2e for end-to-end tests. Update docs.
* Move normalizeUrl test to a jest unit test, makes no sense to be in the mocha e2e tests
* Switch from babel-preset-es2015 to babel-preset-env,
  with target.node=4.0. Seem like it's today's most convenient
  way to support the latest ES and let babel transpile to what
  makes sense for our currently minimal node version
2017-11-14 08:05:01 -05:00
Ronan Jouchet
be4b9a7436 Fix #327 - Update dependencies (except eslint), default to Electron 1.6.6 (#341) 2017-04-18 17:30:54 -04:00
Goh Jia Hao
f262252ade Implement downloading of files
- Fixes #185
2016-05-26 22:50:40 +08:00
Goh Jia Hao
6fd275f063 Update default electron version to v1.0.2 2016-05-13 12:51:05 +08:00
Jia Hao
8f06c555e5 Don't modify the window title 2016-01-30 00:30:25 +08:00
Jia Hao
b7e2fbf86e Add sourcemaps support for placeholder app 2016-01-24 21:20:29 +08:00
zweicoder
9ac18e071e Implement Electron Window State Manager 2016-01-23 14:33:55 +08:00
Jia Hao
1f44e93659 Use browserify to precompile app npm modules 2016-01-22 18:03:35 +08:00
Jia Hao
5cb20e9244 Implement authentication that requires a new window to be opened referenced in #19
- Issue https://github.com/jiahaog/nativefier/issues/19#issuecomment-173364234
- When a link that requests a new window is clicked, the app will check if the link is an external link. If so, the default desktop browser (Chrome, Safari etc.) will be opened. Otherwise, a new Electron BrowserWindow will be opened, which supports the use case of logging in to OAuth websites such as feedly.com
2016-01-22 02:05:50 +08:00
Jia Hao
8ad805d820 Make package.json valid 2016-01-19 18:04:49 +08:00
Jia Hao
63df4f0283 MIT License 2016-01-19 11:25:54 +08:00
Jia Hao
140c444a96 Added documentation 2015-07-05 15:11:49 +08:00
Jia Hao
104821b759 Initial commit 2015-07-05 14:08:13 +08:00