Created
July 11, 2009 07:57
-
-
Save miya2000/145164 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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