Opera and Youtube (Google) video playback issue (As of April 14th) – Fix

I do use Opera. For the most case, you love or hate the browser, but I’ve gotten to enjoy Opera for a bit now, specially the new Opera 10. Just yesterday, YouTube released a patch to attempt to prevent people from using adblockers and other tools that remove there ads/edit there content. The problem is, when this was added, you cannot view videos on Opera anymore. (And I am sure other some other non-generic browsers too.)

Now I’m not entirely sure if YouTube/Google knew that this was going to happen, but now that I think about it, you solve two birds with one stone — A. You get ads to display, B. Almost everyone watches YouTube, if you cannot, you will probably use another browser, for example, they promote Google Chrome. (Read alot of comments of people switching browsers for the time being until it is fixed.)

Now I’m not sure  wither to blame Opera for not being able to handle the coding, or blame Google for using coding that is far beyond normal standards, when it probably could be solved in a better method. From what I hear, some other non-standard browsers are also having troubles to. Seems shady to me. Even still, there is a solve for Opera that was found.

Here are the steps for a workaround that doesn’t involve you to load a page every time you first open a browser.

1. Open the menu, go to SETTINGS then PREFERENCES.
2. Click the ADVANCE TAB. Find CONTENT on the left side, click that.
3. Click JAVASCRIPT OPTIONS. Look at the bottom where it states USER JAVASCRIPT FOLDER. Is this blank? If so, click CHOOSE, then pick/create a folder where you want this ‘fix’ to be in. If the folder already exists, figure out where the folder is. A simple way is just to copy the folder line and paste it into a address bar.
4. Browse to this new folder or existing folder that you pointed the USER JAVASCRIPT FOLDER to. For me, I go to C:\Users\NiteHawk\AppData\Roaming\Opera\Opera\javascriptl becuase thats where I pointed USER JAVASCRIPT FOLDER too.
5. Create a new file in the USER JAVASCRIPT FOLDER, name it something like ‘youtubefix.js’ .. As long as it is a *.js file,  you will be fine. Open this file up in notepad. (Drag and drop it to notepad or click the .JS file an select NOTEPAD.
6. Input this coding into notepad:

?View Code JAVASCRIPT
// ==UserScript==
// @name        YoutubeProtectionRemover
// @include     http://www.youtube.com/*
// @description Removes lame protection on YouTube
// @copyright 2010, Snap
// ==/UserScript==
 
window.opera.addEventListener(
'BeforeScript',
function (ev){
ev.element.text = ev.element.text.replace("yt.flash.update(swfConfig, forceUpdate);","");
},
 
false);
//end

Thanks to Snap100 for this fix!

Make sure you copy everything, including the //’s lines! It is all needed. SAVE THE FILE!

That should be it. As long as the USER JAVASCRIPT FOLDER is pointed to the folder that you specified with the .js file you just created it will bypass YouTubes changes for now. My recommendation would be to remove this when there is a fix on either YouTube or Operas side. For the most case, I would guess it would involve Opera changing something, nothing you can do when competing with the big guns.

You can download the JS file here and put it in your USER JAVASCRIPT FOLDER here if you are having troubles: YouTubeFix.js

I hope this helps!

Share

Related posts:

  1. Opera pages loading very slow compared to other browsers such as Firefox/Chrome? Then look here for a fix!

About the Author

I mainly focus on Javascript/PHP/C++/.NET applications for everyday and work. I also am working on a remake of Stellar Frontier, an old 2D top down space battle game with a few fellow programmers.