One.com webmail width fix

Fixes the stupid width issue of the first sidebar.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         One.com webmail width fix
// @namespace    http://tampermonkey.net/
// @version      2024-12-11
// @description  Fixes the stupid width issue of the first sidebar.
// @author       BramDriesen
// @match        https://mail.one.com/mail/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=one.com
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(function() {
    'use strict';

    setTimeout(function (){
        // Enlarge the left sidebar.
        document.querySelector("#leftContainer").setAttribute("style", "width: 320px; max-width: 320px");
        document.querySelector("#leftContainer > div.panel1").setAttribute("style", "inset: 0px auto 0px 0px; max-width: 600px;");

        // Update all list labels.
        const elements = document.querySelectorAll(".folderList-label");
        elements.forEach(element => {
            element.setAttribute("style", "max-width: fit-content !important");
        });
    }, 1000);
})();