Bug 1304645 - Add [Learn more] for CSPViolation message and point to MDN docs draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 14 Jun 2018 14:42:28 -0700
changeset 807551 b14288f032c47825dbc9b040320986620aeec70a
parent 806884 75a32b57132f8cba42779555662a057a0416a313
push id113148
push userbgrinstead@mozilla.com
push dateThu, 14 Jun 2018 21:42:40 +0000
bugs1304645
milestone62.0a1
Bug 1304645 - Add [Learn more] for CSPViolation message and point to MDN docs MozReview-Commit-ID: BrOVpmlgHNH
devtools/server/actors/errordocs.js
--- a/devtools/server/actors/errordocs.js
+++ b/devtools/server/actors/errordocs.js
@@ -91,26 +91,28 @@ const ErrorDocs = {
 const MIXED_CONTENT_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Mixed_content";
 const TRACKING_PROTECTION_LEARN_MORE = "https://developer.mozilla.org/Firefox/Privacy/Tracking_Protection";
 const INSECURE_PASSWORDS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Insecure_passwords";
 const PUBLIC_KEY_PINS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Public_Key_Pinning";
 const STRICT_TRANSPORT_SECURITY_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security";
 const WEAK_SIGNATURE_ALGORITHM_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Weak_Signature_Algorithm";
 const MIME_TYPE_MISMATCH_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Content-Type-Options";
 const SOURCE_MAP_LEARN_MORE = "https://developer.mozilla.org/en-US/docs/Tools/Debugger/Source_map_errors";
+const CSP_LEARN_MORE = "https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP";
 const ErrorCategories = {
   "Insecure Password Field": INSECURE_PASSWORDS_LEARN_MORE,
   "Mixed Content Message": MIXED_CONTENT_LEARN_MORE,
   "Mixed Content Blocker": MIXED_CONTENT_LEARN_MORE,
   "Invalid HPKP Headers": PUBLIC_KEY_PINS_LEARN_MORE,
   "Invalid HSTS Headers": STRICT_TRANSPORT_SECURITY_LEARN_MORE,
   "SHA-1 Signature": WEAK_SIGNATURE_ALGORITHM_LEARN_MORE,
   "Tracking Protection": TRACKING_PROTECTION_LEARN_MORE,
   "MIMEMISMATCH": MIME_TYPE_MISMATCH_LEARN_MORE,
   "source map": SOURCE_MAP_LEARN_MORE,
+  "CSP": CSP_LEARN_MORE,
 };
 
 exports.GetURL = (error) => {
   if (!error) {
     return undefined;
   }
 
   const doc = ErrorDocs[error.errorMessageName];