From 0e8bf25559974a4e2b0bfcf555bb104c32404479 Mon Sep 17 00:00:00 2001 From: Mister Rajoy Date: Sat, 6 Feb 2021 22:43:55 +0100 Subject: [PATCH] Fix no cors error --- .../Configuration/configurationpage.html | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html b/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html index d1c4be9..559265b 100644 --- a/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html +++ b/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html @@ -477,21 +477,14 @@ //procces google Fonts - if(document.getElementById("font-picker") != undefined){ + if(document.getElementById("font-picker") != undefined && document.getElementById("font-picker").value != "" ){ var font = document.getElementById("font-picker").value var url = "https://fonts.googleapis.com/css?family=" + font; - var promise = await fetch(url); + var promise = await fetch(url,{mode: 'no-cors'}); css += await promise.text(); css += "html {font-family: '$',sans-serif ; } body,h1,h2,h3 { font-family: '$' ,sans-serif;}".replaceAll("$",font.replaceAll("+"," ")); return css; - // fetch(url).then(function (response) { - // response.text().then(function (text) { - // css += text; - // return css; - // }); - // }); - }else{ return css; } @@ -674,7 +667,7 @@ ''; html += loadPreviews(skin); html += ""; - $("#options").html(html).trigger("create").then(updateBlurSliders()); + $("#options").html(html).trigger("create");