Facebook Volume

Video Volume default to 0.10 every 2 seconds

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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);
}