Greasy Fork镜像 支持简体中文。

ata 演示模式

给 ata 添加演示模式按钮

目前為 2023-02-06 提交的版本,檢視 最新版本

// ==UserScript==
// @license MIT
// @name         ata 演示模式
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  给 ata 添加演示模式按钮
// @author       You
// @match        https://ata.alibaba-inc.com/articles/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=alibaba-inc.com
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    console.log("好的,我们开始添加全屏按钮。");
    let myId="guangfeng_fullscreen"

    function hook(){
        var fullscreenButton=document.createElement('a');
        fullscreenButton.id=myId
        fullscreenButton.text="📺 进入演示模式";
        fullscreenButton.href="javascript:document.querySelectorAll('div[class^=left_],div[class^=nav_]').forEach(el => el.style.display = 'none');document.body.style.zoom = '200%';document.documentElement.requestFullscreen()";
        document.querySelector('div[class^=meta-action_]').appendChild(fullscreenButton);
        document.querySelector("div[class^=right_]").style.maxWidth="100px";
        document.querySelector("div[class^=right_]").style.minWidth="100px"
    };

    var hookInterval = setInterval(function(){
        if(document.querySelector("#"+myId) && document.querySelector("div[class^=right_]")){
            clearInterval(hookInterval);
            console.log("停止检查,注入成功。");
        }else{
            hook();
        }
    }, 200);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址