使 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

posted @ 2019-05-13 12:44  maxuewei2  阅读(553)  评论(0编辑  收藏  举报
这是一段经过10次base64加密的密文:Vm0wd2VFMUhSblJXYTFwT1ZsWndU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