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

@ -1,3 +1,11 @@
2017-11-15
==========
The Google Drive userscript has been updated due to breaking changes in
Greasemonkey 4.0. Remember to generate the script by running:
$ npm run generate-userscript "Your Site Name" http://your-site.example.com/r/*
2017-11-05
==========

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);
}

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.51.3",
"version": "3.51.4",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View File

@ -3247,7 +3247,7 @@ function maybePromptToUpgradeUserscript() {
return;
}
var currentVersion = [1, 3];
var currentVersion = [1, 4];
var userscriptVersion = window.driveUserscriptVersion;
if (!userscriptVersion) {
userscriptVersion = '1.0';