VivaldiHooks - more useful mods!

  • Finally made my first Hook!

    Still have a ways to go in my understanding of how it works, but even a small step forward is something.

    @nomadic said in (Help) Button to hide vertical tabbar?:

    Hadden89 luetage There is the option of using VivaldiHooks to trigger inbuilt Vivaldi commands.

    I am far from an expert at writing a hook mod, but looking at panel-right-toggle-button.js and bookmarks-button.js as examples and setting a breakpoint to see the function that was called on toggling the tab bar, I made this:

    //Toggle tab button before AddressBar
      function toggleTabsOnClick() {
        const WindowActions = vivaldi.jdhooks.require("WindowActions");
      vivaldi.jdhooks.hookClass("toolbars_Toolbar", (origClass) => {
        const React = vivaldi.jdhooks.require("React");
        const SettingsPaths = vivaldi.jdhooks.require("_PrefKeys");
        const ToolbarButton = vivaldi.jdhooks.require("toolbars_ToolbarButton");
        return class extends origClass {
          render() {
            let ret = super.render();
            if ( == SettingsPaths.kToolbarsNavigation) {
                React.createElement(ToolbarButton, {
                  tooltip: "Toggle Tab Bar",
                  onClick: toggleTabsOnClick,
                  image: vivaldi.jdhooks.require("_svg_tabs_large"),
            return ret;

    There is probably a better way to do it, but if you want a button that toggles the tab bar, this works.


  • VivaldiHooks seems to break new profiles including using a clean --user-data-dir. Just leads to a an empty URL.

Log in to reply

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.