Skip to content

Instantly share code, notes, and snippets.

@XP1
Created August 11, 2011 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XP1/1140284 to your computer and use it in GitHub Desktop.
Save XP1/1140284 to your computer and use it in GitHub Desktop.
Fix YouTube Java detection: Bypasses YouTube's complicated Java detection with something simpler. Allows you to use YouTube's Java-based advanced video upload in Opera.
// ==UserScript==
// @name Fix YouTube Java detection
// @version 1.01
// @description Bypasses YouTube's complicated Java detection with something simpler. Allows you to use YouTube's Java-based advanced video upload in Opera.
// @author XP1 (https://github.com/XP1/)
// @namespace https://gist.github.com/1140284/
// @include http*://upload.youtube.*/*
// @include http*://*.upload.youtube.*/*
// ==/UserScript==
// http://upload.youtube.com/my_videos_upload?restrict=java
// http://s.ytimg.com/yt/jsbin/www-upload-vflnB6f84.js
/*jslint browser: true, vars: true, white: true, maxerr: 50, indent: 4 */
(function (opera)
{
"use strict";
opera.addEventListener("BeforeScript", function (userJsEvent)
{
var element = userJsEvent.element;
if (element.src.indexOf("/www-upload") !== -1)
{
element.textContent = element.textContent.replace(/&&\(!navigator\.javaEnabled\(\)\|\|/g, " && navigator.javaEnabled() || (!navigator.javaEnabled() || ");
}
}, false);
}(this.opera));
@XP1
Copy link
Author

XP1 commented Aug 11, 2011

I posted this user JS in this thread:

Can you use You Tube advanced Video File Upload in Opera?:
http://my.opera.com/community/forums/topic.dml?id=1070452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment