mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 02:41:22 +01:00
optimizations
This commit is contained in:
1 parent
66570657a6
commit
a8b79f05e9
1 file changed
+2
-7
@@ -21,12 +21,9 @@ function cLog(text, subtext = '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function doXHR(opts) {
|
function doXHR(opts) {
|
||||||
if (typeof GM_xmlhttpRequest === 'function') {
|
if (typeof GM_xmlhttpRequest === 'function' || typeof GM.xmlHttpRequest === 'function') {
|
||||||
return GM_xmlhttpRequest(opts);
|
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.');
|
console.warn('Unable to detect UserScript plugin, falling back to native XHR.');
|
||||||
|
|
||||||
@@ -73,11 +70,9 @@ function isVideoNotDisliked() {
|
|||||||
function getState() {
|
function getState() {
|
||||||
if (isVideoLiked()) {
|
if (isVideoLiked()) {
|
||||||
return "liked";
|
return "liked";
|
||||||
}
|
} else if (isVideoDisliked()) {
|
||||||
if (isVideoDisliked()) {
|
|
||||||
return "disliked";
|
return "disliked";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "neutral";
|
return "neutral";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user