Commit Graph

19 Commits

Author SHA1 Message Date
Pierre Ossman
7f5b51acf3 Consistently use "sentence case" style
Try to be more consistent in how we capitalize things. Both the "Title
Case" and "Sentence case" styles are popular, so either would work.
Google and Mozilla both prefer "Sentence case", so let's follow them.
2024-11-27 14:40:40 +01:00
Samuel Mannehed
145d235094 Make error handler's focus changes best-effort
When the error handler itself causes an exception, it falls back to a
simple document.write(). This means the proper error dialog isn't shown
when this happens.

The focus changes that were added to the error handler in e1f8232b are
not crucial for its function. If these focus changes causes an exception
we can just ignore that.
2022-10-12 13:01:23 +02:00
Samuel Mannehed
4ecb44111d Check if activeElement exists before using it
According to MDN, document.activeElement can be null if there is no
focused element.
2022-10-12 12:39:49 +02:00
Samuel Mannehed
e1f8232bc9 Block user interaction when fallback error shows
When this error is shown, something has gone very wrong. It shows when
a bug in the JavaScript causes an uncaught error. In these scenarios we
dont want the user to be able to interact with the GUI or the remote
session, since we can't guarantee that things work.
2022-10-07 14:55:00 +02:00
Pierre Ossman
c143a852b1 Convert error handler to ES6 module
We no longer support older browsers, so this is not allowed to use
modern features.
2021-11-22 14:03:59 +01:00
Pierre Ossman
2f602da961 Ignore ResizeObserver errors
It seems that Firefox has a bug where these are fired incorrectly when
we are in an <iframe>. The events also contain no useful details, so we
can't really do anything useful with them anyway.
2021-11-22 13:53:05 +01:00
Samuel Mannehed
412d93060d Update copyright to 2019 for modified files 2019-09-30 15:35:33 +02:00
Pierre Ossman
2c5491e131 Enforce space after function name 2018-09-06 17:34:15 +02:00
Pierre Ossman
e777765320 Enforce function names 2018-09-06 16:53:40 +02:00
Juanjo Diaz
651c23ece3 Use fat arrow functions const foo = () => { ... }; for callbacks
and any other function that is passed around and it's not a top level function
2018-07-12 19:06:57 +02:00
Juanjo Diaz
2b5f94fa6a Prefer const/let over var 2018-05-24 00:27:09 +03:00
Pierre Ossman
7d60e97cc9 Only show error stack if it is not empty
Parsing errors will not have a stack, and we don't want an empty
box in those cases.
2018-03-21 15:33:14 +01:00
Pierre Ossman
858ea4a774 Avoid use of 'let' and 'const'
They are not supported on older browsers, e.g. iOS 9.
2017-06-02 15:41:37 +02:00
Pierre Ossman
545442afc3 Merge branch 'keyboard' of https://github.com/CendioOssman/noVNC 2017-05-04 12:18:55 +02:00
Pierre Ossman
5a3e9d3da8 Error.error can be null in some cases 2017-05-04 12:13:48 +02:00
Pierre Ossman
732233eda0 Handle partial error location information
We might not get line or column number, but the file is still
useful information.
2017-03-27 16:29:38 +02:00
Pierre Ossman
5da03103a3 ErrorEvent.error isn't always set
It's not just a matter of the browser lacking support.
2017-03-27 16:29:38 +02:00
Pierre Ossman
c361080be8 Use monospace font for unhandled errors
The browsers uses crude layout formatting that expects this.
2017-03-27 16:29:38 +02:00
Solly Ross
adfc9d3f54 Move error handler into separate file
This commit moves the global error handler into a separate file,
so that it can catch module loading errors.

This also adds support for properly displaying error messages with
newlines in them (since the module loader may throw those)
2017-03-21 17:39:07 -04:00