Skip to content

Instantly share code, notes, and snippets.

@miya2000
Created July 11, 2009 07:57
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 miya2000/145164 to your computer and use it in GitHub Desktop.
Save miya2000/145164 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name nicovideo - fix restorePlayer for Opera10.
// @author miya2000
// @namespace http://d.hatena.ne.jp/miya2000/
// @include http://www.nicovideo.jp/watch/*
// @exclude http://*http*
// ==/UserScript==
javascript:(function F() {
if (window.restorePlayer) {
window.restorePlayer = function () {
// -- original code. -- //
Event.stopObserving(window, "resize", fitPlayerToWindow, false);
$("flvplayer").setStyle({ width: "", height: "" });
var container = $("flvplayer_container");
[container].concat(container.ancestors()).invoke("setStyle", { margin: "", padding: "", width: "", height: "" });
container.setStyle(containerStyle);
$("PAGEHEADER", "WATCHHEADER", "WATCHFOOTER", "PAGEFOOTER").invoke("show");
//Element.scrollTo($("flvplayer_container")); // <- fix target.
if (typeof rotationAdvertisement != "undefined")
rotationAdvertisement.resume();
// -- append code. -- //
setTimeout(function() {
Element.scrollTo($("flvplayer_container"));
}, 0);
}
}
else {
window.addEventListener('load', F, false);
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment