Log relevant security errors to the Web Console

ASSIGNED
Assigned to

Status

()

Core
Security
--
minor
ASSIGNED
4 years ago
2 years ago

People

(Reporter: grobinson, Assigned: grobinson)

Tracking

(Depends on: 3 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

4 years ago
This is a tracking bug for all open bugs requesting security error logging to the Web Console.

Thanks to 837351, we can now log security errors relevant to web developers to a dedicated pane in the Web Console (and simultaneously to the Error Console). We also now have a dedicated security.properties file to use for storing localizable message strings. New security features should use this functionality, and I will create additional bugs to fix any security features that do not currently log to the Web Console but should, or that log to the incorrect pane (previously it was common to overload the JS pane).
(Assignee)

Updated

4 years ago
Assignee: nobody → grobinson
Status: NEW → ASSIGNED
Depends on: 837351, 713980, 821877, 846918
(Assignee)

Comment 1

4 years ago
In order to have your errors appear in the web console, use the following checklist:

1. Your error messages should be localized strings. If you are reporting from Gecko code, I recommend storing the strings in dom/locales/en-US/chrome/security/security.properties. You can then use the eSECURITY_PROPERTIES enum value to reference it. If you use format string specifiers in your messages, make sure you leave comments explaining them for the localization team!
2. Report an nsIScriptError, either by creating the error object and reporting it to the nsIConsoleService manually, or by using the nsContentUtils::ReportToConsole helper function.
3. Define a category for your errors. We currently use specific strings like "CSP", "CORS", etc.
4. Modify categoryForScriptError() in browser/devtools/webconsole/webconsole.js code so it sorts nsIScriptErrors with this category into the appropriate group (JS, CSS, Security, etc.). Simply add a new case statement with the category of your new errors.
(Assignee)

Updated

4 years ago
Depends on: 875456
(Assignee)

Updated

4 years ago
Depends on: 762593
Depends on: 792161

Updated

4 years ago
Depends on: 898712
Depends on: 902691
(Assignee)

Updated

4 years ago
Depends on: 892273
Depends on: 769525
Depends on: 1115151
You need to log in before you can comment on or make changes to this bug.