1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// ==UserScript==
// @name 脚本2
// @namespace Scripts
// @match *://test2.adsdesk.cn/*
// @grant none
// @version 1.0
// @author -
// @require https://unpkg.com/l-watermark@2.1.1/dist/l-watermark.umd.js
// @description 2023/12/6 13:42:17
// ==/UserScript==
(function () {
'use strict';
console.log("begin")
setInterval(addWatermark, 1000)
let myWaterMark;
function addWatermark() {
if (myWaterMark) {
myWaterMark.remove()
}
myWaterMark = WaterMark.page({
targe: document.body,
text: '模拟环境[' + 'xbz' + ']' + getNowTime(),
color: "rgba(0, 0, 0, 0.1)",
fontSize: 24
})
}
function getNowTime() {
const now = new Date();
let year = now.getFullYear(),
month = now.getMonth() + 1,
date = now.getDate(),
h = now.getHours(),
m = now.getMinutes(),
s = now.getSeconds()
month = month < 10 ? '0' + month : month
date = date < 10 ? '0' + date : date
h = h < 10 ? '0' + h : h
m = m < 10 ? '0' + m : m
// year + "-" + month + "-" + date + " " +
return h + ":" + m + ":" + s;
}
console.log("end")
})()