Block Websites for your Kids

Blocks Access to websites you do not want your kids seeing!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Block Websites for your Kids
// @namespace    https://greasyfork.org/en/users/744284-moatazomr
// @version      0.6
// @description  Blocks Access to websites you do not want your kids seeing!
// @author       Moataz Omar
// @match        *://*/*
// @compatible   Chrome
// @compatible   Firefox
// @compatible   Edge
// @grant        none
// @copyright    GPL
// ==/UserScript==


(function() {
    'use strict';
// ---Variables---

var host = window.location.hostname.replace('www.', '');
 //   alert(host);

var result = searchHost(host);
    if(host.indexOf("duckduckgo")>-1)
       {

    $("a[data-zci-link=\"videos\"]").remove();
    $(".module").remove();

    if(location.href.toString().indexOf('videos') >0)
    {
       location.href= location.href.replace(/videos/g, ' ');
        //alert('open=' +location.href.replace(/videos/g, ' '));
    }

       }


})();

function blockedUrl()
{
    var doc = document;
var con = confirm;
var al = alert;
var page_reload = open('https://duckduckgo.com/', '_self').close();




// ---Functions---
doc.title = 'Forbiden Content';
//con("This Site is NOT for Kids! Go watch some YouTube instead!")&&window.open("");
//al("Website Blocked!");
page_reload;

al("Parental Advisory: Website Contains Explicit Content not suited for children!")
//window.open("");
}

function searchHost(host)
{
   // host = 'twinkbfvideos.com';
 fetch("https://raw.githubusercontent.com/chadmayfield/pihole-blocklists/master/lists/pi_blocklist_porn_top1m.list")
            .then(function (response) {
                response.text().then(function (responseText) {
               //   alert( (host)  );
                    if(responseText.indexOf(host)>= 0 || customlist.indexOf(host)>= 0 )
                    {
                        blockedUrl();
                    }
                });
            });
}
//https://github.com/StevenBlack/hosts

var customlist =
    'youm7.com;\
google.com;\
wikimedia.org;';