Nativefier/app/src/static
Dominic Hopton e064f765cb Fix CSS & JavaScript injection (Fixes #703, Fixes #731, PR #732)
* Fix for CSS Injection not working (#703)

Issue:
When using `onHeadersReceived`, the code was passing `null` for the filters.
This appears to trigger behaviour that matches _no_ urls at all.
This results in it never being called to inject the CSS.

Fix:
Pass an empty array instead. Now it's called for all URLs.

Tests pass & linting is clean

* Fix JavaScript injection (#731)

Issue:
It appears that on low endd evices (Core m3 MacBook), the attachment to
`DOMContentLoaded` happens _after_ the event has been raised, so does
not have a chance to inject the script.

Fix:
Move the attachment to the top of the file -- before the imports. This
triggers a bunch of linting erros, so also added disablement inplace.

Additional:
Clarified when the injected JS gets loaded, and what it can assume about
the DOM.
2019-01-01 23:38:45 -05:00
..
login Update eslint and use Airbnb style 2017-04-29 22:52:12 +08:00
.eslintrc.yml Update eslint and use Airbnb style 2017-04-29 22:52:12 +08:00
preload.js Fix CSS & JavaScript injection (Fixes #703, Fixes #731, PR #732) 2019-01-01 23:38:45 -05:00