保持微博账号登录,避免烦人的跳转。
当前为
// ==UserScript==
// @name Weibo Keepalive
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 保持微博账号登录,避免烦人的跳转。
// @author lujjjh
// @license MIT
// @match https://weibo.com/*
// @match https://www.weibo.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=weibo.com
// @grant none
// @run-at document-end
// ==/UserScript==
{
let keepalive = () => {
const iframe = document.createElement('iframe');
Object.assign(iframe.style, {
position: 'absolute',
left: '-1000px',
top: '0',
width: '1px',
height: '1px'
});
iframe.src = `https://${location.host}/login.php?url=https%3A%2F%2F${location.host}%2F%3Fsudaref%3Dlogin.sina.com.cn`;
document.body.append(iframe);
setTimeout(() => void iframe.remove(), 10e3);
};
setInterval(keepalive, 300e3);
keepalive();
}