Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters

This commit is contained in:
Ajay
2022-09-01 15:21:23 -04:00
3 changed files with 14 additions and 8 deletions

View File

@@ -72,7 +72,7 @@ function getFormattedTime(seconds: number, precise?: boolean): string {
* @returns {string} errorMessage
*/
function getErrorMessage(statusCode: number, responseText: string): string {
const postFix = ((responseText && !responseText.includes(`cf-wrapper`)) ? "\n\n" + responseText : "");
const postFix = ((responseText && !(responseText.includes(`cf-wrapper`) || responseText.includes("<!DOCTYPE html>"))) ? "\n\n" + responseText : "");
// display response body for 4xx
if([400, 429, 409, 0].includes(statusCode)) {
return chrome.i18n.getMessage(statusCode + "") + " " + chrome.i18n.getMessage("errorCode") + statusCode + postFix;