Hide Irrelevant Videos

Removes other languages so the view is more clean

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Hide Irrelevant Videos
// @description  Removes other languages so the view is more clean
// @namespace    http://theanykey.se
// @include      https://www.jw.org/apps*
// @include      *jw.org/apps*
// @version      1.0
// ==/UserScript==

// Setup
ShowVideosInLanguage="Svenska"

// Check for Play buttons and remove them
var p = document.getElementsByClassName('aVideoURL');
//var cstr = "container-fluid-header";
for (var i=p.length; --i>=0;) 
{
    var n = p[i];
    //while(n.className.split(" ").indexOf(cstr)==-1) {
    //    n = n.parentNode;
    //}
    if (n)
    {
    	n.parentNode.removeChild(n);
    }
}

// Check for Text buttons and remove them (except swedish)
var p = document.getElementsByClassName('linkDnld');
var cstr = ShowVideosInLanguage;
for (var i=p.length; --i>=0;) 
{
    var n = p[i];
    if (n.innerHTML.indexOf(cstr)==-1) {
        if (n)
        {
            n.parentNode.removeChild(n);
        }      
    }
    else
    {
        if (n)
        {
            //n.setAttribute("download","MyFile.mp4");
        }
    }
}

// Remove for BR
var p = document.getElementsByTagName('BR');
for (var i=p.length; --i>=0;) 
{
    var n = p[i];
    if (n)
    {
        n.parentNode.removeChild(n);
    }      
}

// Remove long lines in <p>
var p = document.getElementsByTagName('P');
var cstr = "-----------------------------------------------------";
for (var i=p.length; --i>=0;) 
{
    var n = p[i];
    if (n.innerHTML.indexOf(cstr)!=-1) {
        if (n)
        {
            n.parentNode.removeChild(n);
        }      
    }
}

// Remove dead links
var p = document.getElementsByClassName('deadlinks');
//var cstr = "container-fluid-header";
for (var i=p.length; --i>=0;) 
{
    var n = p[i];
    //while(n.className.split(" ").indexOf(cstr)==-1) {
    //    n = n.parentNode;
    //}
    if (n)
    {
    	n.parentNode.removeChild(n);
    }
}