Commit Graph

347 Commits

Author SHA1 Message Date
Adam Weeden 46424f9795
Make macOS "bundle identifier" mention Nativefier (fix #866) (#1259)
* Make macos bundle identifier mention nativefier

* Fix @types/debug here too

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-09-21 17:32:55 -04:00
Ronan Jouchet e222e99b56 Bump default Electron to 13.4.0 2021-09-20 11:38:15 -04:00
Adam Weeden bf4be860cf
Upgrade to Electron 13 (#1230)
* Catch promise errors better

* Move subFunctions to bottom of createNewWindow

* Use parents when creating child BrowserWindow instances

* Some about:blank pages have an anchor (for some reason)

* Inject browserWindowOptions better

* Interim refactor to MainWindow object

* Split up the window functions/helpers/events some

* Further separate out window functions + tests

* Add a mock for unit testing functions that access electron

* Add unit tests for onWillPreventUnload

* Improve windowEvents tests

* Add the first test for windowHelpers

* Move WebRequest event handling to node

* insertCSS completely under test

* clearAppData completely under test

* Fix contextMenu require bug

* More tests + fixes

* Fix + add to createNewTab tests

* Convert createMainWindow back to func + work out gremlins

* Move setupWindow away from main since its shared

* Make sure contextMenu is handling promises

* v13.1.2

* v13.1.4

* Update Webkit version for Safari

* 13.1.6 -> NO CRASH!

* Fix types/debug build error on Ubuntu

* 13 -> 13.1.7

* Bump default Firefox version

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-07-19 13:03:46 -04:00
Ronan Jouchet 97b33b369f Bump default Electron from 12.0.12 to 12.0.14
- https://github.com/electron/electron/releases/tag/v12.0.13
- https://github.com/electron/electron/releases/tag/v12.0.14
2021-07-10 15:59:38 -04:00
Adam Weeden b74c0bf959
Make app strict TypeScript + linting (and add a shared project) (#1231)
* Convert app to strict typing + shared library

* Fix new code post-merge

* Remove extraneous lint ignores

* Apply suggestions from code review

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* Fix prettier complaint

* Dedupe eslint files

* Fix some refs after merge

* Fix clean:full command

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-06-26 09:59:28 -04:00
Ronan Jouchet 9893d19085 Bump default Electron to 12.0.12 2021-06-25 16:10:12 -04:00
Adam Weeden dc0e6cb68f
Fix app keeping running in the background after closed (--tray false regression) (PR #1242)
By tightening up typing and logic around tray options.
2021-06-25 16:03:23 -04:00
Adam Weeden d69d4b253a
Fix tray icon always on (regression from #1235) 2021-06-22 19:09:11 -04:00
Adam Weeden a491e34966
Fix `--tray start-in-tray` (fix #1225) (#1235) 2021-06-22 01:22:46 -04:00
Adam Weeden 7a08a2d676
Enable TypeScript strict:true, and more typescript-eslint rules (#1223)
* Catch promise errors better

* Move subFunctions to bottom of createNewWindow

* Use parents when creating child BrowserWindow instances

* Some about:blank pages have an anchor (for some reason)

* Inject browserWindowOptions better

* Interim refactor to MainWindow object

* Split up the window functions/helpers/events some

* Further separate out window functions + tests

* Add a mock for unit testing functions that access electron

* Add unit tests for onWillPreventUnload

* Improve windowEvents tests

* Add the first test for windowHelpers

* Move WebRequest event handling to node

* insertCSS completely under test

* clearAppData completely under test

* Fix contextMenu require bug

* More tests + fixes

* Fix + add to createNewTab tests

* Convert createMainWindow back to func + work out gremlins

* Move setupWindow away from main since its shared

* Make sure contextMenu is handling promises

* Fix issues with fullscreen not working + menu refactor

* Run jest against app/dist so that we can hit app unit tests as well

* Requested PR changes

* Add strict typing; tests currently failing

* Fix failing unit tests

* Add some more eslint warnings and fixes

* More eslint fixes

* Strict typing on (still issues with the lib dir)

* Fix the package.json import/require

* Fix some funky test errors

* Warn -> Error for eslint rules

* @ts-ignore -> @ts-expect-error

* Add back the ext code I removed
2021-06-15 22:20:49 -04:00
Ronan Jouchet 9d0a2f5b44 Bump default Electron to 12.0.11 2021-06-14 14:39:51 -04:00
Ronan Jouchet ea24a0fdeb Fix gitcloud 0.2.3 import 2021-06-14 14:39:43 -04:00
Ronan Jouchet 5673989117 Bump default Electron to 12.0.10 2021-06-04 16:18:34 -04:00
Adam Weeden 72de7b3fca
Refactor app window creation/events + add some unit tests; fix #1197 (#1203)
* Catch promise errors better

* Move subFunctions to bottom of createNewWindow

* Use parents when creating child BrowserWindow instances

* Some about:blank pages have an anchor (for some reason)

* Inject browserWindowOptions better

* Interim refactor to MainWindow object

* Split up the window functions/helpers/events some

* Further separate out window functions + tests

* Add a mock for unit testing functions that access electron

* Add unit tests for onWillPreventUnload

* Improve windowEvents tests

* Add the first test for windowHelpers

* Move WebRequest event handling to node

* insertCSS completely under test

* clearAppData completely under test

* Fix contextMenu require bug

* More tests + fixes

* Fix + add to createNewTab tests

* Convert createMainWindow back to func + work out gremlins

* Move setupWindow away from main since its shared

* Make sure contextMenu is handling promises
2021-06-02 15:18:32 -04:00
Ronan Jouchet 62ee24662c More test:watch fix: bring upgrade to Jest 27 from TheCleric' closed jest-ts PR
See https://github.com/nativefier/nativefier/pull/1204
2021-06-02 00:35:19 -04:00
Adam Weeden 86a27d4f39
Allow non-ascii app names like 微信读书 (fix #1056) (#1207)
* Resolves #1056 Allow non-ascii app names like 微信读书

* Update src/utils/sanitizeFilename.ts

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* Fix prettier

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-05-31 23:27:32 -04:00
Adam Weeden d6730f7022
Improve user agent handling/provide user agent "short" codes (#1198) 2021-05-21 23:41:13 -04:00
Ronan Jouchet cc02b87de7
Get rid of "docs" folder (#1194)
It contains a weird mix of stuff and hides valuable files from view at the root of the repo. Better to have:
- Docs at the root
- Rest of the github/release-related hodgepodge (screenshots, scripts) in hidden folder .github
2021-05-21 18:16:59 -04:00
Adam Weeden 1a810e5ce5
Organize CLI flags into groups (for better --help usability) (#1191)
* Organize CLI options for better UX

* Fix some documentation

* Whoops. Stupid VS Code linter.

* Fix prettier issues

* Make paths less unixy in tests

* Update src/cli.test.ts

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* Apply suggestions from code review

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* Add example to reference CATALOG.md

* Make honest appear near user-agent

* Standardize descriptions

* Hide flash options

* Add explanation of parsed._

* Redo groups in yargs

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-05-18 22:02:55 -04:00
Ronan Jouchet 3fd34549d6 Bump to Electron 12.0.7 2021-05-15 13:12:34 -04:00
Knallli 668ca723dc
CATALOG.md: Add Spotify (PR #1187)
Co-authored-by: Knallli <41125802+Knallli@users.noreply.github.com>
Co-authored-by: Adam Weeden <adamweeden@gmail.com>
Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-05-12 19:53:47 -04:00
Ronan Jouchet d61a4e709a Make prettier happier 2021-05-10 10:23:56 -04:00
Ronan Jouchet 331fe8db39
Fix logging out users on upgrade / app recreate with same URL (fix #1176) (PR #1179)
This is a follow-up of https://github.com/nativefier/nativefier/pull/1162#discussion_r623766247

PR #1162 introduced a new `generateRandomSuffix` helper function,
used it for its needs (avoiding collisions of injected js/css).

But it also replaced existing appname normalizing logic with it,
introducing randomness in a place that used to be deterministic.

As a result, starting with dd6e15fb5 / v43.1.0, re-creating an app would cause
the app to use a different appName, thus a different appData folder, thus
losing user data including cookies.

This PR leaves the `--inject` fixes of #1176, but reverts the appName logic
to the pre-#1176 code.
2021-05-03 11:16:50 -04:00
Ronan Jouchet 36a9e2d616 Bump to Electron 12.0.6 with security fixes
See https://github.com/electron/electron/releases/tag/v12.0.6
2021-05-01 10:48:29 -04:00
Adam Weeden bcdbd58f06
App: replace console.xyz calls with loglevel.xyz, with a level controlled by app argv --verbose (#1172)
In reference to request in https://github.com/nativefier/nativefier/pull/1168/files#r623753290 ,
this PR fixes a lot of the disparity in logging in the app, and fleshes the logging out a bit.
2021-04-30 23:21:37 -04:00
Adam Weeden 895c11a53e
Support setting the browserWindow's language (fix #175) (PR #1173 ) 2021-04-30 23:16:57 -04:00
Adam Weeden 7dc189ef3f
Support creating self-contained "portable" apps writing their app data to the app folder (fix #376) (PR #1168)
In response to #376

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-04-30 23:10:12 -04:00
Adam Weeden dd6e15fb5c
Fix injecting multiple css/js files (fix #458) (#1162)
* Add ability to inject multiple css/js files

* API doc: Move misplaced macOS shortcuts doc (PR #1158)

When I added this documentation originally, I guess I placed it in the wrong location.

* README: use quotes in example, to divert users from shell globbing pitfalls

Follow-up of https://github.com/nativefier/nativefier/issues/1159#issuecomment-827184112

* Support opening URLs passed as arg to Nativefied application (fix #405) (PR #1154)

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* macOS: Fix crash when using --tray (fix #527), and invisible icon (fix #942, fix #668) (#1156)

This fixes:

1. A startup crash on macOS when using the `--tray` option; see #527.
  ![image](https://user-images.githubusercontent.com/22625791/115987741-99544600-a5b6-11eb-866a-dadb5640eecb.png)
2. Invisible tray icon on macOS; see #942 and #668.  
   ![image](https://user-images.githubusercontent.com/22625791/115988276-24364000-a5b9-11eb-80c3-561a8a646754.png)

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* API.md / --widevine: document signing apps to make some sites like HBO Max & Udemy work (fix #1147)

* Prompt to confirm when page is attempting to prevent unload (#1163)

Should alleviate part of the issue in #1151

* Add an option to upgrade an existing app (fix #1131) (PR #1138)

This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can.
Should help fix #1131

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>

* Bump to Electron 12.0.5 with Chrome 89.0.4389.128

* Add newly discovered Google internal login page (#1167)

* Fix Widevine by properly listening to widevine-... events, and update docs (fix #1153) (PR #1164)

As documented in #1153, for Widevine support to work properly, we need to listen for the Widevine ready event, and as well for certain sites the app must be signed.

This PR adds the events, and as well adds better documentation on the signing limitation.

This may also help resolve #1147

* Improve suffix creation + tests

* API: clarif in existing doc by the way

* Typo

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
Co-authored-by: Ben Curtis <github@nosolutions.com>
Co-authored-by: Fabian Wolf <22625791+fabiwlf@users.noreply.github.com>
2021-04-30 11:04:10 -04:00
Adam Weeden f6e1ebd876
Fix Widevine by properly listening to widevine-... events, and update docs (fix #1153) (PR #1164)
As documented in #1153, for Widevine support to work properly, we need to listen for the Widevine ready event, and as well for certain sites the app must be signed.

This PR adds the events, and as well adds better documentation on the signing limitation.

This may also help resolve #1147
2021-04-29 13:27:55 -04:00
Ronan Jouchet a19ccd5fda Bump to Electron 12.0.5 with Chrome 89.0.4389.128 2021-04-28 22:05:17 -04:00
Adam Weeden 9330c8434f
Add an option to upgrade an existing app (fix #1131) (PR #1138)
This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can.
Should help fix #1131

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-04-28 22:00:31 -04:00
Fabian Wolf cf8e51e7ab
macOS: Fix crash when using --tray (fix #527), and invisible icon (fix #942, fix #668) (#1156)
This fixes:

1. A startup crash on macOS when using the `--tray` option; see #527.
  ![image](https://user-images.githubusercontent.com/22625791/115987741-99544600-a5b6-11eb-866a-dadb5640eecb.png)
2. Invisible tray icon on macOS; see #942 and #668.  
   ![image](https://user-images.githubusercontent.com/22625791/115988276-24364000-a5b9-11eb-80c3-561a8a646754.png)

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-04-28 20:25:15 -04:00
Chris Dzombak b4ddd6865c
Support defining a custom bookmarks menu (fix #1065) (PR #1155)
This PR adds an optional, customizable menu of predefined bookmarks. In addition to containing a list of bookmarks, this file customizes the name of the menu and (optionally) allows assigning keyboard shortcuts to bookmarks. It adds a new command-line flag, `--bookmarks-menu <string>`, which can be set as the path to a JSON file containing configuration for the bookmarks menu.

Example of such a JSON file:

```json
{
    "menuLabel": "Music",
    "bookmarks": [
        {
            "title": "lofi.cafe",
            "url": "https://lofi.cafe/",
            "type": "link",
            "shortcut": "Cmd+1"
        },
        {
            "title": "beats to relax/study to",
            "url": "https://www.youtube.com/watch?v=5qap5aO4i9A",
            "type": "link",
            "shortcut": "Cmd+2"
        },
        {
            "type": "separator"
        },
        {
            "title": "RÜFÜS DU SOL Live from Joshua Tree",
            "type": "link",
            "url": "https://www.youtube.com/watch?v=Zy4KtD98S2c"
        }
    ]
}
```

## Checks
- [x] `npm run ci` passes

## Notes

Compared to the fork linked in #1065, this PR:
- adds no dependencies
- doesn't currently support submenus (this should be easy enough to add, but I didn't need it)

## Screenshot

<img width="853" alt="screenshot" src="https://user-images.githubusercontent.com/102904/115882015-5493a800-a41a-11eb-85ef-a190f3dbfe76.png">
2021-04-23 21:46:34 -04:00
Ronan Jouchet 83b1c10269 Bump to Electron 12.0.4 with Chrome 89.0.4389.114
With recent security fixes.
See https://github.com/electron/electron/releases/tag/v12.0.4
and https://github.com/electron/electron/releases/tag/v12.0.3
2021-04-13 21:49:31 -04:00
Ronan Jouchet 1474ebc8bc Bump to Electron 12.0.2 with Chrome 89.0.4389.90
See https://github.com/electron/electron/releases/tag/v12.0.2
2021-04-11 20:47:16 -04:00
Ronan Jouchet da06d933df Old build detection: bump to 90 days, let packagers customize message 2021-04-11 20:40:41 -04:00
Ronan Jouchet dcadfb0bca Bump to Electron 12.0.1 with Chrome 89.0.4389.82 2021-03-10 20:25:33 -05:00
Ronan Jouchet 12373b620e Doc/API: update outdated --internal-urls "second-level-domain" stuff
See https://github.com/nativefier/nativefier/pull/1126
and c0a6604676
2021-03-10 19:49:22 -05:00
Ronan Jouchet 74a7d3375d App: revert addition of extra flag --internal-login-pages
See discussion at https://github.com/nativefier/nativefier/pull/1124#issuecomment-794751514 :

> @TheCleric I was about to merge this, then reconsidered one little thing (yes I wrote "little", I'm not reconsidering this whole thing 😅).
>
> I'm re-considering having the extra flag. I'm not so sure this will harm a lot of use cases. I'd like to 1. merge this PR, 2. immediately follow up with a small commit removing the flag & adjusting api.md, 3. release with the change well-documented / asking for feedback if this is problematic to anyone. (I'm not asking you any extra work, and like leaving an in-tree commit trace of considering the flag). If people complain with a valid reason, we'll restore the flag with a quick revert, else we're happy with one less flag and a reasonably-handled breaking change.
>
> Thoughts / objections?

Answered by:

> That seems reasonable to me.
>
> [discussion on an extra structured way to pass flags]
2021-03-10 19:36:20 -05:00
Adam Weeden 6f7e80bafd
App: Automatically consider known login pages as internal (fix #706) (PR #1124)
Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-03-10 19:20:53 -05:00
Adam Weeden 8f9135312b
Docker: fix Windows builds (fix #997), line endings, switch to Alpine (PR #1122)
- Docker builds for Windows are fixed (fixes #997)
- Switched over to use Alpine (as was indicated as desired in https://github.com/nativefier/nativefier/issues/375#issuecomment-304247033) - which may mean #375 is fixed as well.
- Fixed bug where Docker has the wrong line endings when copying from a Windows host
- Fixed the invalid `arm` arch to `armv7l`
- Add `npm t` to the docker build to ensure tests pass before we start trying to do builds
- Add a message to help the user when trying to build Mac apps on Windows as a non-Admin (currently an unhelpful exception)

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-03-02 00:16:30 -05:00
C. Mangla cbb4380583
Icon conversion: support GraphicsMagick in addition to ImageMagick (PR #1002)
Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-02-28 14:21:28 -05:00
Adam Weeden adcf21a3df
macOS: Prompt for accessibility permissions if needed by Global Shortcuts using Media Keys (Fix #1120) (PR #1121)
When setting a media key (play, pause, next/previous track) as global shortcut in Mac OS 10.14+, accessibility permissions must be given to the app for it to work (see https://www.electronjs.org/docs/api/global-shortcut?q=MediaPlayPause#globalshortcutregisteraccelerator-callback).

This PR will accomplish the following on generated app launch:
- Check if global shortcuts are being setup
- Check if the host OS is Mac OS
- Check if the global shortcuts were one of the media keys
- If the above are true, check if the app has accessibility permissions
- If the app does not have the accessibility permissions it will ask the user if they would like to be prompted for these permissions, and then ask Mac OS to prompt for accessibility permissions.

~~As well, a new command line flag is added (`--no-accessibility-prompt`) to preventatively suppress these prompts if desired.~~

Screenshots of the new behavior:
![Screen Shot 2021-02-26 at 2 41 21 PM](https://user-images.githubusercontent.com/547567/109356260-76bfde00-784e-11eb-8c36-3a51b911b780.png)
![Screen Shot 2021-02-26 at 2 41 28 PM](https://user-images.githubusercontent.com/547567/109356266-79223800-784e-11eb-94eb-66437c05fd10.png)
![Screen Shot 2021-02-26 at 2 41 50 PM](https://user-images.githubusercontent.com/547567/109356270-7aebfb80-784e-11eb-9e90-e09bb49752c6.png)

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-02-28 10:24:14 -05:00
Ronan Jouchet fe79fd622d Doc extra electron update stuff 2021-02-25 18:46:27 -05:00
Ronan Jouchet f4a0479a11 Bump default Electron to 11.3.0 with the icon fix (with Chromium 87.0.4280.141) 2021-02-25 18:28:29 -05:00
Ronan Jouchet 5ea4638aea Fix lint 2021-02-25 18:19:30 -05:00
Ronan Jouchet 9b52f210db Get rid of dependency "shelljs"
We don't need a fancy _"portable (Windows/Linux/macOS) implementation
of Unix shell commands on top of the Node.js API"_, we just want to run
a simple script. Replacing with using stdlib `child_process.spawnSync`.
2021-02-25 18:15:24 -05:00
Jia Hao 6316d23762 Move to nativefier organization 2021-01-30 04:49:52 +00:00
Jia Hao 66ff02584e Temporarily increase timeout for network call in test 2021-01-30 04:49:36 +00:00
Ronan Jouchet 10f7fed290 Revert default Electron back to 11.1.1 (Chrome 87.0.4280.88) (fix #1101)
Not doing anything more complicated (adding macOS-specific code
or adding code always passing an icon), let's instead wait for
Electron to fix the issue.
2021-01-18 09:18:43 -05:00
Ronan Jouchet dc353bebaf More filename & appname sanitization 2021-01-16 08:40:04 -05:00
Ronan Jouchet 3b28dc46cc Bump default Electron to 11.2.0 (with Chromium 87.0.4280.141) 2021-01-16 08:18:33 -05:00
Ronan Jouchet b0a953eb2d Get rid of cheerio
Not sure this one will stick, maybe my regex is too naive.
Works for common websites. Let's see
2021-01-15 22:15:48 -05:00
Ronan Jouchet 35d926b959 Fix inferIcon error surfacing in full since recent axios 2021-01-15 21:57:19 -05:00
Ronan Jouchet 17f688de63 Get rid of lodash 2021-01-15 21:50:07 -05:00
Ronan Jouchet 7fd0c748ba Fix arg validation regression in #1080 with --{x,y} (fix #1084) 2020-12-07 16:50:59 -05:00
Ronan Jouchet f4af78018f Fix arg validation regression in #1080 (fix #1083) 2020-12-06 23:19:02 -05:00
Ronan Jouchet 7c5b2bb68f Bump default Electron to 11.0.3, bump dep eslint-config-prettier to 7.x, bump version to something far away from current Electron version
Rationale for nonsensical major version bump: around Nativefier 8.x,
versions of Nativefier and Electron aligned, by release schedule coincidence.
Since Nativefier has little breaking changes, it was great: as Electron
releases are breaking, Nativefier had no breaking changes, I bumped our
major version on new major Electron, and everything was good.

Except *now*, as I have a breaking change, that would bump Nativefier to
12.x, which would be confusing since we'd still default to Electron 11 :-/ .

-> To keep respecting semver and reduce confusion, bumping Nativefier
   version to something far ahead. No it doesn't matter, version
   number are meaningless anyway (well, outside of semver, whose
   respect is precisely the point here).
2020-12-06 13:57:51 -05:00
erythros 27ecfcbeca
Check for improperly-formatted arguments (fix #885) (PR #1080)
Verifies short arguments do not contain an extra dash ( right: `-h`, error: `--h` )
Verifies long arguments contain at least two dashes ( right: `--help`, error: `-help` )
2020-12-06 12:34:32 -05:00
Matthew Ruzzi e8d3530b43
Warn on old Electron/Chrome (fix #556) (PR #1076)
Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2020-11-30 21:45:35 -05:00
erythros 3e0011a29c
Fix icon path error when passing asar (--conceal) flag (fix #975) (PR #1074)
By moving icon copy before packaging by `electron-packager` occurs.
2020-11-30 14:51:19 -05:00
Ronan Jouchet 292416b83f Bump default Electron to 11.0.2 2020-11-21 11:28:00 -05:00
erythros bbd51ad988
Support using a Widevine-enabled Electron for DRM playback (fix #435) (PR #1073) 2020-11-21 09:39:07 -05:00
Matthew Ruzzi 2c10d122f3
Bump default Electron to 10.1.5 (with Chromium 85.0.4183.121) (#1066)
Fixes [CVE-2020-15999](https://github.com/advisories/GHSA-pv36-h7jh-qm62) Heap overflow in the freetype library by upgrading to Electron [10.1.5](https://github.com/electron/electron/releases/tag/v10.1.5) 

https://github.com/electron/electron/pull/26070
2020-11-08 20:29:11 -05:00
Ronan Jouchet 7f3ebb1a69 On successful build, better explain how to run the app and what to do with it (fix #1029) 2020-08-29 16:41:33 -04:00
Ronan Jouchet cb4ab05e7b cli: document arm64 arch 2020-08-29 16:21:42 -04:00
Ronan Jouchet b1d0d6857f Bump default Electron to 10.1.0, bump to TS 4.x 2020-08-29 16:16:25 -04:00
Cassidy James Blaede 1c06af23fa
inferOs: Add support for arm64 (#1037)
Tested on a Pinebook Pro running elementary OS
2020-08-29 16:12:22 -04:00
Ronan Jouchet 85629434e6 Bump default Electron to 9.2.0 2020-08-10 21:42:57 -04:00
Ronan Jouchet b8b5cd5bc4 Document child process named "Electron" when building windows apps under non-Windows and without Wine (fix #1022) 2020-08-10 21:37:45 -04:00
davidfant bd077756e8
Emit TS type declarations, and type NativefierOptions (#1016)
This PR adds better Typescript support when using the Node module directly:
1. Generate type declarations when running `tsc`
2. Created the `NativefierOptions` type for the `buildNativefierApp` function instead of using `any`
2020-08-05 20:26:41 -04:00
Joe Skeen 8e8cd24e0d
Add `--block-external-urls` flag to forbid external navigation attempts (Fix #978 - PR#1012)
Fixes #978 

Adds a `--block-external-urls` option (default: `false`) that prevents opening external links (as classified by the `--internal-urls` option).

Documentation and tests updated.


Example:
```
nativefier --internal-urls "classroom\.google\.com" --block-external-urls
```
![image](https://user-images.githubusercontent.com/12286274/88739501-f12d5180-d0f7-11ea-9821-86f3e9bfa070.png)
![image](https://user-images.githubusercontent.com/12286274/88739512-fab6b980-d0f7-11ea-877c-7bd565352a93.png)
2020-08-02 14:31:47 -04:00
Ronan Jouchet 8684887fc6 Bump eslint to 7.x, fix new lint errors 2020-07-18 11:19:58 -04:00
Ronan Jouchet 792156f376 Bump deps: electron-packager, ts-loader, types 2020-07-18 01:47:46 -04:00
Ronan Jouchet c18fc1ef9a Bump default Electron to 9.1.0 2020-07-18 01:36:32 -04:00
Ronan Jouchet e5ba8c779f Bump default Electron to 9.0.4, bump deps (jest, electron-context-menu) 2020-06-13 10:23:15 -04:00
Luke Hamburg 6b81324531
--help: fix typo, clarify --icon helptext (PR #976)
- correct small typo (`he`→`the`)
- clarify that `--icon` accepts .icns on macOS
2020-06-13 10:05:43 -04:00
Alexander Weps 1d3bed5f09
Fix: notifications (fix #88, fix #956), processEnvs, using as git (#955)
1. Fix (broken since 2016): Notifications broken by lambda constructor
2. Fix: `--processEnvs` broken by additional processEnvs object, the result was:
`processEnvs: {processEnvs: {...}}` which caused the conversion of the inner object into string `[object Object]`, no nesting allowed there probably. Compatibility introduced.
3. Fix: package.json missing `prepare` (or even prepublish), which breaks using as git dependency.
2020-04-27 11:52:21 -04:00
Ronan Jouchet eef320a150 Bump default Electron to 8.2.3, and bump app/electron-context-menu to 1.x 2020-04-22 22:09:13 -04:00
Ronan Jouchet fafaead442 Bump default Electron to 8.2.1 2020-04-06 22:01:32 -04:00
Ronan Jouchet 0c2510f31e Bump default Electron to 8.2.0 and Prettier 2020-03-24 20:27:25 -04:00
Ronan Jouchet 86cf42844f Log a helpful error when failing to parse JSON arg (fix #928) 2020-03-20 21:03:37 -04:00
Ronan Jouchet d6e7aa6f41 Fix inferTitle test broken on Node 8 2020-03-15 17:19:19 -04:00
Ronan Jouchet c9ee6667d4
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 16:50:01 -04:00
Ronan Jouchet 97f092b77b Bump default Electron to 5.0.13 2020-01-23 19:57:18 -05:00
Siddharth Srinivasan 010f88aa1b Fix weirdly platform-dependent folder naming logic (PR #850, fix #708) 2020-01-15 09:09:37 -05:00
otato.z ef13ff1e1d feat: proxy rules with `--proxy-rules` flag (#854)
See https://electronjs.org/docs/api/session?q=proxy#sessetproxyconfig-callback
2019-10-22 19:38:39 -04:00
FabulousCupcake d0a0614ba3 Add --browserwindow-options to completely expose Electron options (PR #835)
This adds a new flag `--browserwindow-options`, taking a stringified JSON object as input.  
It will be inserted directly into the options when BrowserConfig is initialized.

This allows total configurability of the electron BrowserWindow configuration via nativefier.

An example use case is added to the documentation, which modifies the default font family in the browser.

#### References

- https://github.com/electron/electron/blob/master/docs/api/browser-window.md#new-browserwindowoptions
  - See the following for electron v3.1.7
  - https://github.com/electron/electron/blob/v3.1.7/docs/api/browser-window.md#new-browserwindowoptions
2019-08-22 21:37:49 +02:00
Umair Ahmed 81c422d4e0 Support setting background color (fixes #795) (PR #819)
Adds a `--background-color` flag for the background of the window when the app isn't loaded.
2019-08-22 21:25:58 +02:00
Nate Woolls 5433569921 Support macOS 10.4+ Dark Mode, default to Electron 5.x (#796)
Introduces a `--darwin-dark-mode-support` flag. 
(I kept the same flag used by Electron Packager.)
This required bumping Electron and Electron Packager.

Addresses:

- https://github.com/jiahaog/nativefier/issues/733
- https://github.com/jiahaog/nativefier/issues/727
2019-08-22 21:05:39 +02:00
Ronan Jouchet 5cdfe96cbe Bump default electron to 3.1.7 2019-03-25 11:19:33 -04:00
Ronan Jouchet 726f44d266 Bump default Electron to 3.1.3 2019-02-09 21:46:15 -05:00
Adrian DC 5b6cc89f22 Fix #316: Add --clear-cache flag to cleanup session on start/exit ("incognito" mode) (PR #747)
- Add a new `clearCache` option and `--clear-cache` parameter
  to trigger session cleanups upon window launch and close

- Covers the feature request from issue #316 

- Use case example: Forcing authentification / login between sessions without limiting cache size
2019-02-08 10:03:29 -05:00
Dword 3588f8a85f Icon conversion: don't crash if source/destination paths have spaces (PR #736) 2019-01-09 10:08:17 -05:00
Ronan Jouchet d6b4b23f0a Bump default Electron to 3.0.13 2019-01-01 23:42:50 -05:00
Felix Eckhofer 8600c78d1a Add --start-in-tray CLI flag to let app start in background (PR #564, Fixes #522) 2018-12-01 14:04:55 -05:00
Ronan Jouchet cb7e17b8e3 Bump default Electron to 3.0.10 2018-11-30 23:42:28 -05:00
Benedikt Rötsch 3029cba01f Support global shortcuts that trigger input events (PR #698, Fixes #15)
This adds a new flag, allowing the user to define global shortcuts that trigger input events within the main window.

That way, I could easily wrap SoundCloud and Deezer to create a native app which reacts on my keyboard media buttons.
2018-11-04 21:03:52 -05:00
Hugo Locurcio 35c66b02b5 Update documentation URLs in the CLI help message (#683)
This updates URLs in the command-line help to avoid redirects.
2018-10-26 21:45:19 -04:00
Ronan Jouchet 0f88a761de Bump default electron to 3.0.3, deps (eslint-plugin-prettier) 2018-10-06 22:13:47 -04:00