zoukankan      html  css  js  c++  java
  • 使 Firefox 和 Vivaldi 只在新标签页显示书签栏

    Firefox

    新建
    ~/.mozilla/firefox/rre9emvh.default/chrome/userChrome.css (大概不同人的 rre9emvh.default 目录会有不同的名字?)

    内容如下

    /*
     * Bookmarks toolbar is visible only on new tab page, just like Chrome.
     *
     * Screenshot: https://vimeo.com/235059188
     * Video: https://vimeo.com/240436456
     *
     * Contributor(s): https://www.reddit.com/user/AJtfM7zT4tJdaZsm and Andrei Cristian Petcu
     *                 https://www.reddit.com/r/FirefoxCSS/comments/7evwow/show_bookmarks_toolbar_only_on_new_tab/
     */
    
    #main-window #PersonalToolbar {
      visibility: collapse !important;
    }
    
    #main-window[title^="about:newtab"] #PersonalToolbar,
    #main-window[title^="New Tab"] #PersonalToolbar,
    #main-window[title^="Nightly"] #PersonalToolbar,
    #main-window[title^="Mozilla Firefox"] #PersonalToolbar,
    #main-window[title^="Firefox"] #PersonalToolbar,
    #main-window[title^="新标签页"] #PersonalToolbar,
    #main-window[title^="Customize Firefox"] #PersonalToolbar {
      visibility: visible !important;
    }
    

    Vivaldi

    修改 /opt/vivaldi/resources/vivaldi/browser.html,
    添加以下内容

    <script src="style/common.js"></script>
    

    修改 /opt/vivaldi/resources/vivaldi/style/common.js
    添加以下内容

    /**
     * Author: Leonardo Domingues
     */
    
    setTimeout(function wait() 
    {
        var adr = document.querySelector(".toolbar-addressbar.toolbar");
            if (adr != null) 
            {
                const vivaldi = window.chrome;
    
                var bar = document.getElementsByClassName('bookmark-bar')[0];
                    
                function change_display()
                {
                    var tab = document.querySelector('.active.webpageview');
    
                    if (tab.classList.contains('internal')) 
                    {
                        bar.style.display = "flex";
                    }else
                    {
                        bar.style.display = "none";
                    }
                }
    
                vivaldi.tabs.onCreated.addListener(e => change_display());
    
                vivaldi.tabs.onUpdated.addListener(e => change_display());
    
                vivaldi.tabs.onActivated.addListener(e => change_display());
            }
            else {
                setTimeout(wait, 300);
            }
    }, 300);
    

    END

  • 相关阅读:
    win10 的MQTT + apache-apollo服务器使用
    网络协议 4
    nginx 命令
    win7安装两个jdk,1.7和1.8,下载、安装、配置环境变量,方便切换
    AC+DP练习
    BZOJ 1093 [ZJOI2007]最大半连通子图
    BestCoder Round #52 (div.1)
    洛谷1012 拼数
    洛谷1980 计数问题
    洛谷1424 小鱼的航程(改进版)
  • 原文地址:https://www.cnblogs.com/maxuewei2/p/10856007.html
Copyright © 2011-2022 走看看