Facebook Volume

Video Volume default to 0.10 every 2 seconds

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Facebook Volume
// @namespace   https://www.facebook.com/
// @version     0.1
// @description Video Volume default to 0.10 every 2 seconds
// @match       https://www.facebook.com/*
// @copyright   2012+, Me
// @grant       none
// ==/UserScript==

var VolumeIDList = [];
var VolumeDefault = 0.30;    // 這裏設定音量大小

setTimeout(FindAndSetVolumes, 2000);

function FindAndSetVolumes() {
var VideoPlayerList = document.getElementsByTagName("video");
var Len = VideoPlayerList.length;
var def_this_run = 0;
for(var i=0;i<Len;i++) {
if( VolumeIDList[VideoPlayerList[i].id] === undefined ) {
VolumeIDList[VideoPlayerList[i].id] = true;
VideoPlayerList[i].volume = VolumeDefault;
def_this_run++;
}
}
var d = new Date();
console.log(d+" - Defaulted: "+def_this_run);

setTimeout(FindAndSetVolumes, 2000);
}