/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * Get the MDN URL for the specified header. * * @param {string} header Name of the header for the baseURL to use. * * @return {string} The MDN URL for the header, or null if not available.
*/ function getHeadersURL(header) { const lowerCaseHeader = header.toLowerCase(); const idx = SUPPORTED_HEADERS.findIndex(
item => item.toLowerCase() === lowerCaseHeader
); return idx > -1
? `${MDN_URL}Web/HTTP/Headers/${SUPPORTED_HEADERS[idx] + getGAParams()}`
: null;
}
/** * Get the MDN URL for the specified HTTP status code. * * @param {string} HTTP status code for the baseURL to use. * * @return {string} The MDN URL for the HTTP status code, or null if not available.
*/ function getHTTPStatusCodeURL(statusCode, panelId) { return (
(SUPPORTED_HTTP_CODES.includes(statusCode)
? `${MDN_URL}Web/HTTP/Status/${statusCode}`
: MDN_STATUS_CODES_LIST_URL) + getGAParams(panelId)
);
}
/** * Get the URL of the Timings tag for Network Monitor. * * @return {string} the URL of the Timings tag for Network Monitor.
*/ function getNetMonitorTimingsURL() { return `${USER_DOC_URL}network_monitor/request_details/#network-monitor-request-details-timings-tab`;
}
/** * Get the URL for Performance Analysis * * @return {string} The URL for the documentation of Performance Analysis.
*/ function getPerformanceAnalysisURL() { return `${USER_DOC_URL}network_monitor/performance_analysis/`;
}
/** * Get the URL for Filter box * * @return {string} The URL for the documentation of Filter box.
*/ function getFilterBoxURL() { return `${USER_DOC_URL}network_monitor/request_list/#filtering-by-properties`;
}
/** * Get the MDN URL for Tracking Protection * * @return {string} The MDN URL for the documentation of Tracking Protection.
*/ function getTrackingProtectionURL() { return `${MDN_URL}Mozilla/Firefox/Privacy/Tracking_Protection${getGAParams()}`;
}
/** * Get the MDN URL for CORS error reason, falls back to generic cors error page * if reason is not understood. * * @param {int} reason: Blocked Reason message from `netmonitor/src/constants.js` * * @returns {string} the MDN URL for the documentation of CORS errors
*/ function getCORSErrorURL(reason) { // Map from blocked reasons from netmonitor/src/constants.js to the correct // URL fragment to append to MDN_URL const reasonMap = new Map([
[1001, "CORSDisabled"],
[1002, "CORSDidNotSucceed"],
[1003, "CORSRequestNotHttp"],
[1004, "CORSMultipleAllowOriginNotAllowed"],
[1005, "CORSMissingAllowOrigin"],
[1006, "CORSNotSupportingCredentials"],
[1007, "CORSAllowOriginNotMatchingOrigin"],
[1008, "CORSMIssingAllowCredentials"],
[1009, "CORSOriginHeaderNotAdded"],
[1010, "CORSExternalRedirectNotAllowed"],
[1011, "CORSPreflightDidNotSucceed"],
[1012, "CORSInvalidAllowMethod"],
[1013, "CORSMethodNotFound"],
[1014, "CORSInvalidAllowHeader"],
[1015, "CORSMissingAllowHeaderFromPreflight"],
]); const urlFrag = reasonMap.get(reason) || ""; return `${MDN_URL}Web/HTTP/CORS/Errors/${urlFrag}`;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.