Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add our own Content Security Policy headers when Better Errors responds, which heavily restricts the resources that can be used/referenced, but allows our scripts and styles. It uses a nonce for the script blocks, but currently we rely on inline style because of the way syntax highlighting works (which will change someday, for example in #423).
Turbolinks (of course)
When Turbolinks is in use, our headers are not evaluated by the browser when loading the console page. If the CSP headers sent by the application restrict inline CSS and JS, the console will not function or be presented correctly.
So we also provide fallback modes, where the user is informed of the reason and given a link to open Better Errors in a new tab. This fallback includes the topmost frame infomation, so essentially the same information as the "text" version is available on the page, even if not well-formatted.
When inline style is available but inline script is not:
When inline style is not available but script is:
When both are not available: