• Community
    • Community
    • Vivaldi Social
    • Blogs
  • Forum
    • Vivaldi Forum
    • Categories
    • Recent
    • Popular
  • Themes
    • Vivaldi Themes
    • My Themes
    • FAQ
  • Contribute
    • Contribute
    • Volunteer
    • Donate
  • Browser
    • Vivaldi Browser
    • Latest News
    • Snapshots
    • Help
Register Login

Vivaldi

  • Community
  • Themes
  • Contribute
  • Browser

Navigation

    • Home
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Desktop
    3. Customizations & Extensions
    4. Modifications
    5. AutoHide Tab Bar + Address Bar | Show on Hover

    AutoHide Tab Bar + Address Bar | Show on Hover

    Scheduled Pinned Locked Moved Modifications
    207 Posts 44 Posters 49.1k Views 14 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Abhimanyu @oudstand
      last edited by Abhimanyu

      @oudstand @shenghuoyishujia Thanks. What modifications does one need to do if address and tab bars aren't on the top?

      @outstand can you mention some other similar (mouse hover to reveal address/tab bar) projects as i was unable to find them on the forum.

      oudstand
      O
      S
      2 Replies Last reply
      Reply Quote 0
    • stardepp
      S
      stardepp Translator Ambassador @oudstand
      last edited by

      @oudstand I like this mod very much.

      Kindly asked: Is there a way to create a command chain for this mod, so that this key combination to create a button to place it e.g. on the status bar?

      🍀 Work spaces changed my work flow🍀Search Engine Collection🍀My Themes🍀Windows11 24H2🍀Samsung Galaxy A 54 5G | Android 15 🍀

      oudstand
      O
      owhs
      O
      2 Replies Last reply
      Reply Quote 0
    • oudstand
      O
      oudstand Supporters @Abhimanyu
      last edited by

      @Abhimanyu I would have to check this in a week when I am back from vacation

      A
      1 Reply Last reply
      Reply Quote 0
    • oudstand
      O
      oudstand Supporters @stardepp
      last edited by

      @stardepp said in some javascript to automatically hide tab bar and address bar and show them by hovering:

      @oudstand I like this mod very much.

      Kindly asked: Is there a way to create a command chain for this mod, so that this key combination to create a button to place it e.g. on the status bar?

      I also tried to this, but couldn't manage it. You would have to set the property into chromes local storage, but if you create a JS booklet and combine it with the command chains, then the scope is wrong.

      stardepp
      S
      1 Reply Last reply
      Reply Quote 0
    • stardepp
      S
      stardepp Translator Ambassador @oudstand
      last edited by

      @oudstand In the meantime, I have come up with another solution. I have a programmable Logitech keyboard. I have set the key combination (Ctrl+Alt+F) to the F3 key. It works well.

      🍀 Work spaces changed my work flow🍀Search Engine Collection🍀My Themes🍀Windows11 24H2🍀Samsung Galaxy A 54 5G | Android 15 🍀

      oudstand
      O
      1 Reply Last reply
      Reply Quote 2
    • S
      shenghuoyishujia @Abhimanyu
      last edited by

      @Abhimanyu
      I am sorry that I usually set my task bar of win11 hide automatically. So I never try to set address bar and tab bar at the bottom. And I wonder if this may conflict with task bar.

      I sincerely hope the Vivaldi will have this feature out of box in the future.

      1 Reply Last reply Reply Quote 0
    • owhs
      O
      owhs
      last edited by owhs

      I made a version that is a "tab only" mode;

      • When active, it hides: address ui, bookmarks bars (if active), footer... Does NOT hide side panel
      • Activated by double clicking a tab
      • The address ui pops up when cursor is over tabs

      https://gist.github.com/owhs/95e9a0c17fd57aca95577fd7e39dc188

      demo

      edit: note, it's not perfect, but i kept it as much css as possible, would be fixed by using slightly better js logic

      1 Reply Last reply Reply Quote 8
    • owhs
      O
      owhs @stardepp
      last edited by

      @stardepp said in some javascript to automatically hide tab bar and address bar and show them by hovering:

      @oudstand I like this mod very much.

      Kindly asked: Is there a way to create a command chain for this mod, so that this key combination to create a button to place it e.g. on the status bar?

      @stardepp said in some javascript to automatically hide tab bar and address bar and show them by hovering:

      @oudstand In the meantime, I have come up with another solution. I have a programmable Logitech keyboard. I have set the key combination (Ctrl+Alt+F) to the F3 key. It works well.

      made a toggle button in the panel - for my tab only version
      demo

      full version:
      https://gist.github.com/owhs/84597d9614a021717d25f5e86420cf73

      // select the flexible spacer div
      var panelEl = document.querySelector("#panels-container .toolbar-panel>.toolbar-spacer-flexible");
      
      // parseHTML:
      var p = document.createElement("div");
      p.innerHTML = '...';
      
      // divider:
      var div = p.children[0];
      // inject divider before flexible spacer
      panelEl.before(div);
      
      // button, add before divider:
      var btnC = p.children[0];
      div.before(btnC);
      
      // on button click do something
      btnC.querySelector("button").addEventListener("click", ()=>toggleHide());
      
      
      stardepp
      S
      1 Reply Last reply
      Reply Quote 3
    • stardepp
      S
      stardepp Translator Ambassador @owhs
      last edited by stardepp

      Bild Text

      🍀 Work spaces changed my work flow🍀Search Engine Collection🍀My Themes🍀Windows11 24H2🍀Samsung Galaxy A 54 5G | Android 15 🍀

      1 Reply Last reply Reply Quote 0
    • oudstand
      O
      oudstand Supporters @stardepp
      last edited by

      @stardepp said in some javascript to automatically hide tab bar and address bar and show them by hovering:

      @oudstand In the meantime, I have come up with another solution. I have a programmable Logitech keyboard. I have set the key combination (Ctrl+Alt+F) to the F3 key. It works well.

      If you change in this line:
      (id, combination) => combination === "Ctrl+Alt+F" && toggleFullScreen() the Ctrl+Alt+F to F3 or another key combination , you can adjust the shortcut aswell

      Y
      1 Reply Last reply
      Reply Quote 2
    • A
      Abhimanyu @oudstand
      last edited by Abhimanyu

      @oudstand @shenghuoyishujia thanks. One additional modification i would suggest be that whenever the mouse hovers over the tab and address bar, the window should remain static and only the tab and address bar should overlay(if that is the correct technical term) the window similar to firefox fullscreen mode.

      oudstand
      O
      2 Replies Last reply
      Reply Quote 0
    • Y
      ydivho12123 @oudstand
      last edited by

      @oudstand
      It's great now, but the page changes over and over again. Is it possible to change it so that whenever the mouse hovers over the tab and the address bar, the window should remain static and the address bar can be overlaid on top of the page content?

      1 Reply Last reply Reply Quote 0
    • oudstand
      O
      oudstand Supporters @Abhimanyu
      last edited by

      @Abhimanyu @ydivho12123 I've tested a bit around and noticed, that it's not easily possible to make the header, URL bar and bookmarks float over the website. Setting them to display: absolute destroys the styling of the elements inside. When I've got more time I will take a look again.

      1 Reply Last reply Reply Quote 1
    • oudstand
      O
      oudstand Supporters @Abhimanyu
      last edited by

      @Abhimanyu @ydivho12123 I had a spontaneous idea how to solve your request and it really worked. So here is my solution:

      /**
       * Forum link: https://forum.vivaldi.net/topic/92477/some-javascript-to-automatically-hide-tab-bar-and-address-bar-and-show-them-by-hovering
       * Hides the tab bar and address bar when not hovering
       */
      (function checkWebViewForFullscreen() {
          const webView = document.querySelector("#webview-container");
          if (!webView) {
              setTimeout(checkWebViewForFullscreen, 1337);
              return;
          }
      
          const header = document.querySelector("#header"),
              browser = document.querySelector("#browser"),
              mainBar = document.querySelector(".mainbar"),
              bookmarkBar = document.querySelector(".bookmark-bar");
      
          let fullscreenEnabled;
          chrome.storage.local.get("fullScreenModEnabled").then((value) => {
              fullscreenEnabled = value.fullScreenModEnabled || value.fullScreenModEnabled == undefined;
              if (fullscreenEnabled) {
                  setMarginAndZIndex(fullscreenEnabled);
                  addFullScreenListener();
              }
          });
      
          vivaldi.tabsPrivate.onKeyboardShortcut.addListener(
              (id, combination) => combination === "Ctrl+Alt+F" && toggleFullScreen()
          );
      
          const style = document.createElement("style");
          style.appendChild(document.createTextNode("[hidden] { transform: translateY(-100px) !important; }"));
          document.head.appendChild(style);
      
          const hoverDiv = document.createElement("div");
          hoverDiv.style.height = "9px";
          hoverDiv.style.width = "100vw";
          hoverDiv.style.position = "fixed";
          hoverDiv.style.left = "0";
          hoverDiv.style.top = "0";
          hoverDiv.style.zIndex = "1";
          document.body.insertBefore(hoverDiv, document.body.firstChild);
      
          function toggleFullScreen() {
              fullscreenEnabled = !fullscreenEnabled;
              setMarginAndZIndex(fullscreenEnabled);
              fullscreenEnabled ? addFullScreenListener() : removeFullScreenListener();
              chrome.storage.local.set({fullScreenModEnabled: fullscreenEnabled})
          }
      
          function addFullScreenListener() {
              webView.addEventListener("pointerenter", hide);
              hoverDiv.addEventListener("pointerenter", show);
              hide();
          }
      
          function removeFullScreenListener() {
              webView.removeEventListener("pointerenter", hide);
              hoverDiv.removeEventListener("pointerenter", show);
              show();
          }
      
          function hide() {
              header.hidden = true;
              mainBar.hidden = true;
              bookmarkBar.hidden = true;
          }
      
          function show() {
              header.hidden = false;
              mainBar.hidden = false;
              bookmarkBar.hidden = false;
      
              browser.classList.remove("address-top-off");
              browser.classList.add("address-top");
          }
      
          function setMarginAndZIndex(shouldAdjustStyles) {
              const headerOffset = header.offsetHeight;
              const mainBarOffset = mainBar.offsetHeight;
      
              adjustStyles(header, shouldAdjustStyles, 0);
              adjustStyles(mainBar, shouldAdjustStyles, headerOffset);
              adjustStyles(bookmarkBar, shouldAdjustStyles, headerOffset + mainBarOffset);
          }
      
          function adjustStyles(element, shouldAdjustStyles, offset) {
              element.style.marginTop = shouldAdjustStyles && offset ? `${offset}px` : "";
              element.style.marginBottom = shouldAdjustStyles ? `-${offset + element.offsetHeight}px` : "";
              element.style.zIndex = shouldAdjustStyles ? 9 : "";
          }
      })();
      
      
      Y
      1 Reply Last reply
      Reply Quote 1
    • Y
      ydivho12123 @oudstand
      last edited by

      @oudstand
      There seems to be some problems with my side of the test, the style becomes frosted glass translucent after ctrl alt f is opened, and the tab bar does cover the page, but it doesn't have the previous function of automatically hiding the tab bar when the mouse moves out

      oudstand
      O
      1 Reply Last reply
      Reply Quote 0
    • oudstand
      O
      oudstand Supporters @ydivho12123
      last edited by

      @ydivho12123 For me it's working fine. Can you post a screenshot? Do you use other mods, that might cause a problem with this?

      Y
      1 Reply Last reply
      Reply Quote 0
    • Y
      ydivho12123 @oudstand
      last edited by

      @oudstand 76259544-55d8-405f-8c61-b8e93a7012d4-image.png
      It's going to turn out like this. I used two mods, one is the js mod that you sent some time ago to hide the tab bar, and the other is the js mod that hides the panel (https://forum.vivaldi.net/post/696245)

      Y
      1 Reply Last reply
      Reply Quote 0
    • Y
      ydivho12123 @ydivho12123
      last edited by

      @ydivho12123
      Which hidden tab js mod worked properly before, and the image was replaced with your new js code

      oudstand
      O
      1 Reply Last reply
      Reply Quote 0
    • oudstand
      O
      oudstand Supporters @ydivho12123
      last edited by

      @ydivho12123 Currently I don't know why this happens on your device. The code to hide the tabs, main bar and book marks uses transform: translateY(-100px) !important; which moves the elements to the top out of the visible area. It shouldn't change the appearance of them. Also together with the other mod the code works for me. Do you have any CSS mods that cause this problem?

      Y
      1 Reply Last reply
      Reply Quote 0
    • Y
      ydivho12123 @oudstand
      last edited by

      @oudstand
      A CSS mod is used, but it's a mod that modifies the panel, and it makes the panel hidden, so it shouldn't affect the tab bar (https://forum.vivaldi.net/post/672126)
      aed791b8-2de0-4783-b27b-b00e4127984e-image.png
      1
      a9426a56-009a-40c5-b66f-feeda8f58214-image.png
      The above two images are not using the new code and can be hidden normally

      oudstand
      O
      1 Reply Last reply
      Reply Quote 0
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    • 1
    • 2
    • 3
    • 4
    • 5
    • 10
    • 11
    • 1 / 11
    • First post
      Last post

    Copyright © Vivaldi Technologies™ — All rights reserved. Privacy Policy | Code of conduct | Terms of use | Vivaldi Status