Commit Graph

1052 Commits

Author SHA1 Message Date
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 f8f48d2f09 Update changelog for `v44.0.5` 2021-06-25 16:17:59 -04:00
Ronan Jouchet 9893d19085 Bump default Electron to 12.0.12 2021-06-25 16:10:12 -04:00
Adam Weeden a6c1dcf952
Fix "Reset Zoom" menu item (fix #1241) (PR #1243) 2021-06-25 16:05:23 -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 8b34c6d12d
Resolves #1228; Don't treat 'about:blank#blocked' as new tabs (#1229) 2021-06-16 23:03:49 -04:00
Ronan Jouchet 37769e463c HACKING.md: mention app pkgjson/devDeps/electron 2021-06-16 19:16:55 -04:00
Ronan Jouchet b2af6f5435 HACKING.md: clarification 2021-06-16 19:15:05 -04:00
Ronan Jouchet 564c616d12 HACKING.md: formatting 2021-06-16 19:13:11 -04:00
Ronan Jouchet 05c3cbfb76 HACKING.md: document major-updating Electron 2021-06-16 19:12:31 -04:00
Ronan Jouchet 996183b949 Update changelog for `v44.0.4` 2021-06-15 22:36:01 -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 7807bbb327 Update changelog for `v44.0.3` 2021-06-15 09:06:44 -04:00
Adam Weeden 113d8448c1
Fix CSS injection (#1227)
This fixes https://github.com/nativefier/nativefier/pull/1222#issuecomment-860913698 , where:

1. When it works (e.g. initial page load), CSS is slower to inject (you can see pages without injected CSS)
2. CSS isn't injected when navigating to a page

On both Windows & Linux, a `git revert 9a6c6f870d && npm run build` fixes the issue.

--

I'm still not 100% sure what went wrong, but I suspect that the new version of Electron may not be firing onHeadersReceived for the actual navigation events, and only its child requests. To counteract it, I'm now injecting at the navigation event as well. I was able to reproduce the issue and this does seem to fix it. Please let me know if it does for you as well..

Also I noticed some funkiness in your logs where we're trying to inject on font files. So I realized the method is probably not nearly as important as the content-type, so I've switched blacklist methods to blacklist content-types.
2021-06-15 09:02:57 -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
Adam Weeden 9a6c6f870d
Selective css injection (#1222)
* Don't inject CSS for unneeded responses

* Remove some non-injectable methods

* Actually check for CSS to inject + unit tests

* Update app/src/helpers/windowHelpers.ts

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

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-06-09 09:49:35 -04:00
Peter Lewis d67f533fa5
README: Update node & npm requirements (#1224)
Update required `node` and `npm` versions to match what's in package.json
2021-06-09 08:14:46 -04:00
Ronan Jouchet 437ae55d2e Update changelog for `v44.0.2` 2021-06-07 17:28:34 -04:00
Ronan Jouchet 4badf3dc70 manual-test: fix shellcheck nits, make tests structure more distinct 2021-06-07 17:27:23 -04:00
Adam Weeden 826625f4a4
Fix HTTP basic auth (fix #1219) (#1220)
Should resolve #1219, as well adds a manual test for basic auth as suggested.

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-06-07 17:09:24 -04:00
Adam Weeden 363fa966ee
Fix tabs opening twice (fix #1209) (#1221)
* Only add a new window handler to the main window

* Update app/src/components/mainWindow.ts

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

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-06-07 16:49:06 -04:00
Ronan Jouchet 460d70f915 Update changelog for `v44.0.1` 2021-06-07 09:38:53 -04:00
Ronan Jouchet 709557c7ab
macOS: fix crash on activating main window (fix #1212) (PR #1213)
```
Uncaught Exception:
TypeError: Cannot read property 'show' of undefined
at App.<anonymous> (/src/main.ts:177:18)
```

Seems like an oversight of the recent refactor.

* macOS: fix crash on activating main window (fix #1210)
* Eliminate need for global mainWindow, refactor widevine / non-widevine events (#1218)

Co-authored-by: Adam Weeden <adamweeden@gmail.com>
2021-06-07 09:35:27 -04:00
Adam Weeden cdc6fa79c2
Fix fullscreen not working + menu refactor (fix #1206) (#1210)
* 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
2021-06-07 08:55:17 -04:00
Ronan Jouchet 16cacb0915 CATALOG.md: Spotify: mention faking user agent may not be necessary 2021-06-04 18:53:38 -04:00
Ronan Jouchet 69bc3306f9 Update changelog for `v44.0.0` 2021-06-04 17:03:35 -04:00
Ronan Jouchet 5d67156deb API.md: cleanup 2021-06-04 16:53:35 -04:00
Ronan Jouchet c6b50e8d0a API.md: add "New in x.y.z" info for (most) flags 2021-06-04 16:45:05 -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 ec12702359 HACKING.md: video doesn't embed, just link to it 2021-06-02 09:52:28 -04:00
Ronan Jouchet 1ceffb1a0d HACKING.md: embed video showing what a live-reload experience looks like
Also, a paragraph on limiting breaking changes
2021-06-02 09:48:57 -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
Ronan Jouchet 6b09d1467f More test:watch fixes & usability
See https://github.com/nativefier/nativefier/pull/1204#issuecomment-852679403
2021-06-01 23:37:04 -04:00
Ronan Jouchet 9c5dba7f07 Fix test:watch requiring two saves to actually run the code/test you just changed
Will fix https://github.com/nativefier/nativefier/pull/1204#issuecomment-852155755
See package.json in comments for description
2021-06-01 20:43:46 -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 6c55e1a9a1
Add login.microsoftonline.com to internal login pages (#1205)
* Add login.microsoftonline.com to internal login pages

* Update API.md

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

* Add extra messaging for adding to internalLoginPages

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-05-29 20:38:24 -04:00
Ronan Jouchet 8801ca5150 app/tsconfig.json: document when to bump compilerOptions, and rationale 2021-05-29 20:07:38 -04:00
Ronan Jouchet 2b780e6c67 Test watcher: warn that it's necessary to run build:watch for the test watcher to work
See https://github.com/nativefier/nativefier/pull/1204#issuecomment-850915981
2021-05-29 19:58:46 -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 4f3b449218 Deps: bump ts-loader from 8 to 9, now that we require Node 12
See https://github.com/TypeStrong/ts-loader/releases
2021-05-21 19:44:53 -04:00
Ronan Jouchet 45db4e7ec6 README: whoopsie, bad rename of animation 2021-05-21 18:17:59 -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
Adam Weeden b3c202fd33
Bump minimum required version: node>=12.9, npm>=6.9 (#1192)
* Move minimum supported version: node=12, npm=6.9

* Add missing bits and documentation for future bumping

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-05-15 13:32:54 -04:00
Ronan Jouchet 9225114e77 Update changelog for `v43.1.3` 2021-05-15 13:28:16 -04:00
Ronan Jouchet 3fd34549d6 Bump to Electron 12.0.7 2021-05-15 13:12:34 -04:00