diff --git a/ChatboxBot.html b/ChatboxBot.html index 7ac6d1d..575a4c7 100644 --- a/ChatboxBot.html +++ b/ChatboxBot.html @@ -61,7 +61,7 @@ - + diff --git a/js/chat.js b/js/chat.js index 0db8f9c..d457631 100644 --- a/js/chat.js +++ b/js/chat.js @@ -141,8 +141,19 @@ if(settings.options.pfpCircle){ pfpImg.style.borderRadius = "50%"; } + try{ pfpImg.src = await getPFP(displayname); nameNode.appendChild(pfpImg); + } + catch{ + try{//retry just in case something silly happened + pfpImg.src = await getPFP(displayname); + nameNode.appendChild(pfpImg); + } + catch{ + console.error(`Failed to load PFP for ${context['display-name']} continuing on without one.`) + } + } } /* diff --git a/js/twitchapi.js b/js/twitchapi.js index 059c32f..bffd5b6 100644 --- a/js/twitchapi.js +++ b/js/twitchapi.js @@ -109,7 +109,7 @@ class API { TwitchAPIEvents.emit('authorize'); } - static async fetch({url, responseHandler, paramobj = {}, headerobj = {}, method = "GET", mode = 'cors', cache = 'default', credentials = 'same-origin', redirect = 'follow', referrerpolicy = 'no-referrer-when-downgrade', urlencode = false, authorizing = false}) {//And so it begins + static async fetch({url, responseHandler, paramobj = {}, headerobj = {}, method = "GET", mode = 'cors', cache = 'default', credentials = 'omit', redirect = 'follow', referrerpolicy = 'no-referrer', urlencode = false, authorizing = false}) {//And so it begins if (urlencode) { headerobj['Content-Type'] = 'application/x-www-form-urlencoded';