Update drive userscript (#714)

This commit is contained in:
Calvin Montgomery 2017-11-15 22:27:31 -08:00
parent 875337d9a6
commit 85169fbb56
4 changed files with 18 additions and 5 deletions

View file

@ -3,11 +3,13 @@
// @namespace gdcytube
// @description Play Google Drive videos on {SITENAME}
// {INCLUDE_BLOCK}
// @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @connect docs.google.com
// @run-at document-end
// @version 1.3.0
// @version 1.4.0
// ==/UserScript==
try {
@ -56,7 +58,7 @@ try {
+ '&hl=en';
debug('Fetching ' + url);
GM_xmlhttpRequest({
GM.xmlHttpRequest({
method: 'GET',
url: url,
onload: function (res) {
@ -100,6 +102,9 @@ try {
error.reason = 'HTTP_ONERROR';
return cb(error);
}
}).catch(function (error) {
error.reason = 'GM.xmlHttpRequest error';
return cb(error);
});
}
@ -204,7 +209,7 @@ try {
unsafeWindow.console.log('Initialized userscript Google Drive player');
unsafeWindow.hasDriveUserscript = true;
unsafeWindow.driveUserscriptVersion = '1.3';
unsafeWindow.driveUserscriptVersion = '1.4';
} catch (error) {
unsafeWindow.console.error(error);
}