This PR allows us to code playwright integration tests that can potentially replace some of our manual tests and allow us automated testing of the app itself.
Current technical limitations:
* No app level keyboard simulation support (e.g, zoom in, zoom out, etc.)
* No code coverage support, so even though we are testing the app, the code coverage does not reflect this fact
* Update electron to 13.4.0 + update browser versions
* Fix injectCSS preventing new windows from opening
* Fix some window/tab opening weirdness/bugs
* Fix unit tests
* Switch to using onResponseStarted to avoid the issues with callbacks in the future
* Clear up comments on onResponseStarted
They were used a long time ago, then I scrapped them for simplicity to
new contributors. I'm re-considering this and re-introducing one, for
two (maybe three) reasons:
1. Reading on supply chain attacks
2. Build broken because of a dep change (see previous commit broken
because of a change in yargs @ 17.1.0)
(3.) Performance
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.
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
Per #1112, I'm adding some common troubleshooting steps to the README. As well, this adds a checkbox requesting users to check this section before submitting a ticket, which will hopefully lead to more self-help.