sojson_maximum

最大化 https://m.sojson.com/editor.html 页面 json 编辑器的窗口

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         sojson_maximum
// @namespace    http://tampermonkey.net/
// @version      20250001
// @description  最大化 https://m.sojson.com/editor.html 页面 json 编辑器的窗口
// @author       hejiangyuan
// @match        https://*.sojson.com/editor.html
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @license      GPL License
// ==/UserScript==

(function() {
    'use strict';

    const t = function() {

        const height = '98vh';

        var ele = document.getElementById('jsonformatter');
        ele.style.minHeight = height;

        ele = document.getElementById('jsoneditor');
        ele.style.minHeight = height;

        const removeElementClassName = ['layui-tab', 'header-fixed', 'layout-header', 'layui-breadcrumb'];
        for (const name of removeElementClassName) {
            ele = document.getElementsByClassName(name);
            if (ele.length > 0) {
                ele[0].parentNode.removeChild(ele[0]);
            }
        }

        ele = document.getElementsByTagName('hr');
        if (ele.length > 0) {
            ele[0].parentNode.removeChild(ele[0]);
        }

        ele = document.getElementsByClassName('layout');
        if (ele.length > 0) {
            ele[0].style.paddingTop = '0';
        }

        document.body.style.overflow = 'hidden';
    }

    setInterval(t, 1000);

})();