海角乱伦

提醒用户当前网页是否安全。根据简单的 URL 检查,提示用户正在访问的网站是否在可信任的网站列表中。

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         海角乱伦
// @namespace    http://your-namespace.com
// @version      1.0
// @description  提醒用户当前网页是否安全。根据简单的 URL 检查,提示用户正在访问的网站是否在可信任的网站列表中。
// @author       YourName
// @match        *://*/*
// @grant        none
// ==/UserScript==

// 安全网址列表
const trustedWebsites = [
    "https://www.google.com",
    "https://www.wikipedia.org",
    "https://www.github.com"
];

// 获取当前页面的 URL
const currentUrl = window.location.href;

// 功能:检查当前网页是否在可信任列表中,并给出相应的提示
function checkWebsiteSafety() {
    if (trustedWebsites.some(url => currentUrl.startsWith(url))) {
        alert("您正在访问的网页是可信任的网站。");
    } else {
        alert("请注意,您正在访问的网页不在信任的网站列表中,请小心操作。");
    }
}

// 执行安全检查
checkWebsiteSafety();