Tab Layout Organizer

Organize suas abas em layouts dentro de um painel lateral

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Tab Layout Organizer
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Organize suas abas em layouts dentro de um painel lateral
// @author       Emerson
// @licence MIT
// @match        *://*/*
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';

    // Cria painel lateral
    const panel = document.createElement('div');
    panel.style.position = 'fixed';
    panel.style.top = '0';
    panel.style.right = '0';
    panel.style.width = '250px';
    panel.style.height = '100%';
    panel.style.background = '#f0f0f0';
    panel.style.borderLeft = '2px solid #ccc';
    panel.style.overflowY = 'auto';
    panel.style.zIndex = '9999';
    panel.style.padding = '10px';
    panel.innerHTML = `
        <h3>Meus Layouts</h3>
        <button id="saveTab">Salvar aba</button>
        <button id="clearTabs">Limpar</button>
        <select id="layoutMode">
            <option value="list">Lista</option>
            <option value="grid">Grade</option>
        </select>
        <div id="tabContainer"></div>
        <hr>
        <small id="doomSignature" style="
            display:block;
            text-align:center;
            margin-top:10px;
            font-weight:bold;
            color:#0ff;
            text-shadow: 
                0 0 5px #0ff,
                0 0 10px #0ff,
                0 0 20px #0ff,
                0 0 40px #0ff;
        ">
            criado por DOOM_
        </small>
    `;
    document.body.appendChild(panel);

    const tabContainer = document.getElementById('tabContainer');
    let tabs = GM_getValue('tabs', []);

    function renderTabs() {
        const mode = document.getElementById('layoutMode').value;
        tabContainer.innerHTML = '';
        tabContainer.style.display = mode === 'grid' ? 'grid' : 'block';
        tabContainer.style.gridTemplateColumns = mode === 'grid' ? '1fr 1fr' : 'none';

        tabs.forEach((tab) => {
            const link = document.createElement('a');
            link.href = tab.url;
            link.textContent = tab.title;
            link.target = '_blank';
            link.style.display = 'block';
            link.style.margin = '5px';
            link.style.padding = '5px';
            link.style.background = '#fff';
            link.style.border = '1px solid #ccc';
            tabContainer.appendChild(link);
        });
    }

    document.getElementById('saveTab').onclick = () => {
        tabs.push({ title: document.title, url: window.location.href });
        GM_setValue('tabs', tabs);
        renderTabs();
    };

    document.getElementById('clearTabs').onclick = () => {
        tabs = [];
        GM_setValue('tabs', tabs);
        renderTabs();
    };

    document.getElementById('layoutMode').onchange = renderTabs;

    renderTabs();
})();