Browse Source

fix my own mistake - 1

Front 3 năm trước cách đây
mục cha
commit
eb362ab17b
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      Extensions/UserScript/Return Youtube Dislike.user.js

+ 4 - 2
Extensions/UserScript/Return Youtube Dislike.user.js

@@ -19,10 +19,12 @@ function cLog(text, subtext = '') {
   console.log(`[Return Youtube Dislikes] ${text} ${subtext}`);
 }
 
-function doXHR(opts) {
-  if (typeof GM_xmlhttpRequest === 'function' || typeof GM.xmlHttpRequest === 'function') {
+  if (typeof GM_xmlhttpRequest === 'function') {
     return GM_xmlhttpRequest(opts);
   }
+  if (typeof GM.xmlHttpRequest === 'function') {
+    return GM.xmlHttpRequest(opts);
+  }
 
   console.warn('Unable to detect UserScript plugin, falling back to native XHR.');