mirror of https://github.com/calzoneman/sync.git
Minor fixes/cleanup
This commit is contained in:
parent
4feee02e33
commit
ba9fbea1a1
|
@ -11,10 +11,6 @@
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
if (!unsafeWindow.enableCyTubeGoogleDriveUserscript) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function debug(message) {
|
function debug(message) {
|
||||||
if (!unsafeWindow.enableCyTubeGoogleDriveUserscriptDebug) {
|
if (!unsafeWindow.enableCyTubeGoogleDriveUserscriptDebug) {
|
||||||
return;
|
return;
|
||||||
|
@ -152,4 +148,5 @@
|
||||||
|
|
||||||
unsafeWindow.GoogleDrivePlayer = GoogleDrivePlayer;
|
unsafeWindow.GoogleDrivePlayer = GoogleDrivePlayer;
|
||||||
unsafeWindow.console.log('Initialized userscript Google Drive player');
|
unsafeWindow.console.log('Initialized userscript Google Drive player');
|
||||||
|
unsafeWindow.hasDriveUserscript = true;
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -32,7 +32,7 @@ window.loadMediaPlayer = (data) ->
|
||||||
console.error e
|
console.error e
|
||||||
else if data.type is 'gd'
|
else if data.type is 'gd'
|
||||||
try
|
try
|
||||||
if data.meta.html5hack
|
if data.meta.html5hack or window.hasDriveUserscript
|
||||||
window.PLAYER = new window.GoogleDrivePlayer(data)
|
window.PLAYER = new window.GoogleDrivePlayer(data)
|
||||||
else
|
else
|
||||||
window.PLAYER = new GoogleDriveYouTubePlayer(data)
|
window.PLAYER = new GoogleDriveYouTubePlayer(data)
|
||||||
|
|
|
@ -217,5 +217,4 @@ function eraseCookie(name) {
|
||||||
/* to be implemented in callbacks.js */
|
/* to be implemented in callbacks.js */
|
||||||
function setupCallbacks() { }
|
function setupCallbacks() { }
|
||||||
|
|
||||||
window.enableCyTubeGoogleDriveUserscript = true;
|
window.enableCyTubeGoogleDriveUserscriptDebug = getOrDefault("cytube_drive_debug", false);
|
||||||
window.enableCyTubeGoogleDriveUserscriptDebug = true;
|
|
||||||
|
|
|
@ -1358,7 +1358,7 @@
|
||||||
}
|
}
|
||||||
} else if (data.type === 'gd') {
|
} else if (data.type === 'gd') {
|
||||||
try {
|
try {
|
||||||
if (data.meta.html5hack) {
|
if (data.meta.html5hack || window.hasDriveUserscript) {
|
||||||
return window.PLAYER = new window.GoogleDrivePlayer(data);
|
return window.PLAYER = new window.GoogleDrivePlayer(data);
|
||||||
} else {
|
} else {
|
||||||
return window.PLAYER = new GoogleDriveYouTubePlayer(data);
|
return window.PLAYER = new GoogleDriveYouTubePlayer(data);
|
||||||
|
|
Loading…
Reference in New Issue