Skip to content

Instantly share code, notes, and snippets.

@os0x
Created July 30, 2008 15:37
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 os0x/3275 to your computer and use it in GitHub Desktop.
Save os0x/3275 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Volumedown for niconico
// @namespace http://d.hatena.ne.jp/nastack/
// @include http://www.nicovideo.jp/watch/*
// ==/UserScript==
(function(unsafeWindow){
var VOLUME = 10;
var meta = document.evaluate("//meta[@name='keywords' and contains(@content,'\u97F3\u91CF\u6CE8\u610F')]",
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if (!meta) return;
var flvplayer = unsafeWindow.$("flvplayer");
var Inter = setInterval(function (){
flvplayer.ext_setVolume(VOLUME);
if (flvplayer.ext_getVolume() == VOLUME) clearInterval(Inter);
}, 100);
})(this.unsafeWindow || window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment