One.com webmail width fix

Fixes the stupid width issue of the first sidebar.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();