소스 검색

Clean up the console warninf message

Nariman Jelveh 1 년 전
부모
커밋
c9e8207e4b
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      packages/puter-js/src/lib/utils.js
  2. 1 1
      src/UI/UIWindowFontPicker.js
  3. 4 4
      src/index.js

+ 1 - 1
packages/puter-js/src/lib/utils.js

@@ -82,7 +82,7 @@ function initXhr(endpoint, APIOrigin, authToken, method= "post", contentType = "
     xhr.open(method, APIOrigin + endpoint, true);
     xhr.setRequestHeader("Authorization", "Bearer " + authToken);
     xhr.setRequestHeader("Content-Type", contentType);
-    xhr.responseType = responseType;
+    xhr.responseType = responseType ?? '';
     return xhr;
 }
 

+ 1 - 1
src/UI/UIWindowFontPicker.js

@@ -55,7 +55,7 @@ async function UIWindowFontPicker(options){
             h += `<div style="padding: 20px; border-bottom: 1px solid #ced7e1; width: 100%; box-sizing: border-box;">`;
                     h += `<div class="font-list" style="margin-bottom: 10px; height: 200px; overflow-y: scroll; background-color: white; padding: 0 10px;">`;
                         fontAvailable.forEach(element => {
-                            h += `<p class="font-selector disable-user-select ${options.default === element ? 'font-selector-active' : ''}" style="font-family: '${html_encode(element)}';" data-font-family="${html_encode(element)}">${element}</p>`; // 👉️ one, two, three, four
+                            h += `<p class="font-selector disable-user-select ${options.default === element ? 'font-selector-active' : ''}" style="font-family: '${html_encode(element)}';" data-font-family="${html_encode(element)}">${html_encode(element)}</p>`; // 👉️ one, two, three, four
                         });
                     h += `</div>`;
 

+ 4 - 4
src/index.js

@@ -141,8 +141,8 @@ window.loadCSS = async function(url) {
         document.head.appendChild(link);
     });
 }
-console.log( "%c⚠️Warning⚠️\n %cPlease refrain from adding or pasting any sort of code here, as doing so could potentially compromise your account. \nYou don't get what you intended anyway, but the hacker will !! \n\n%cfor further information please visit https://developer.chrome.com/blog/self-xss",
-    "color:red; font-size:2rem;margin-left:40%;font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;",
+console.log( "%c⚠️Warning⚠️\n%cPlease refrain from adding or pasting any sort of code here, as doing so could potentially compromise your account. \nYou don't get what you intended anyway, but the hacker will! \n\n%cFor further information please visit https://developer.chrome.com/blog/self-xss",
+    "color:red; font-size:2rem; display:block; margin-left:0; margin-bottom: 20px; background: black; width: 100%; margin-top:20px; font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;",
     "font-size:1rem; font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;",
-    "font-size:0.9rem; font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;"
-);
+    "font-size:0.9rem; font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;",
+);