跳转至

7-前端代码片段

黑暗模式

1
2
3
4
5
F12 
document.documentElement.style.filter='invert(85%) hue-rotate(180deg)'

或者下方代码存入书签
javascript: (function () {  const docStyle = document.documentElement.style;  if (!window.modeIndex) {    window.modeIndex = 0;  }  const styleList = [    '',    'invert(85%) hue-rotate(180deg)',   'invert(100%) hue-rotate(180deg)',  ];  modeIndex = modeIndex >= styleList.length - 1 ? 0 : modeIndex + 1;  docStyle.filter = styleList[modeIndex];  document.body.querySelectorAll('img, picture, video').forEach(el => el.style.filter = modeIndex ? 'invert(1) hue-rotate(180deg)' : '');})();

js发送http post 请求

    function send_seed(value1) {
        var data = {
            webhook: value1,
        };
// 配置fetch请求
        fetch("/addfeed", {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
                'X-CSRFToken':'{{csrf_token}}'
            },
            body: JSON.stringify(data)
        })
            .then(function (response) {
                if (response.ok) {
                    // 解析响应数据
                    return response.json();
                } else {
                    // 请求失败
                    throw new Error("请求失败");
                }
            })
            .then(function (responseData) {
                // 请求成功,处理响应数据
                console.log(responseData);
            })
            .catch(function (error) {
                // 处理错误
                console.error(error);
            });
    }

油猴

给图片添加属性 referrerpolicy=”no-referrer”

(function() {
    'use strict';

    // 获取所有的img标签
    var images = document.getElementsByTagName('img');

    // 遍历所有的img标签并添加referrerpolicy属性
    for (var i = 0; i < images.length; i++) {
        images[i].setAttribute('referrerpolicy', 'no-referrer');
    }
})();