Weibo Keepalive

保持微博账号登录,避免烦人的跳转。

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Weibo Keepalive
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  保持微博账号登录,避免烦人的跳转。
// @author       lujjjh
// @license      MIT
// @match        https://weibo.com/*
// @match        https://www.weibo.com/*
// @match        https://s.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://login.sina.com.cn/sso/login.php?url=https%3A%2F%2Fweibo.com%2Flogin.php`;
    document.body.append(iframe);
    setTimeout(() => void iframe.remove(), 10e3);
  };
  setInterval(keepalive, 300e3);
  keepalive();
}