Address Bar like in Yandex Browser
-
Github: https://github.com/aminought/vivaldi-yb-address-bar
I thought that someone might be interested in the feature that I implemented in my theme Ribbon Theme. This is the address bar, which displays the title of the current page and the domain, clicking on which leads to the homepage of the website.
Screenshots
Color Behind Tabs: ON
Color Behind Tabs: OFF
Accent From Page: OFF
Installation
You need to act as described in the post about modding:
- Place yb_address_bar.js inside
<YOURVIVALDIDIRECTORY>\Application\<VERSION>\resources\vivaldi
. - Add line
<body>
in the<body>
ofwindow.html
. - Restart Vivaldi.
UPD 3/23/2024:
- Fixed domain extraction for chrome extensions.
- Place yb_address_bar.js inside
-
Great job, looks good! Even works fine with my mods:
-
I noticed, that if you visit the website of a extension, the domain button becomes way to large:
To fix this I've added this style:
.YBDomain { height: 100%; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .YBDomain::after { content: attr(data-tooltip); position: absolute; padding: 0.25px 6px; background-color: var(--colorAccentBg); color: var(--colorAccentFg); border-radius: var(--radius); opacity: 0; visibility: hidden; transition: opacity 0.3s; z-index: 2; transform: translateX(calc(-100% + 6px)); } .YBDomain:hover::after { opacity: 1; visibility: visible; }
removed
line-height: 0;
from.YBDomainButton
and calledybDomain.setAttribute('data-tooltip', domain);
in#createYBDomain
.This reduces the size of the button and added a tooltip:
-
@oudstand Thank you, but I have another simple solution:
-
UPD 3/23/2024:
- Fixed domain extraction for chrome extensions.
-
I've updated the last few lines of the mod, because sometimes the mod tries to do stuff, before everything is loaded and fails.
function initMod() { if (document.querySelector('#urlFieldInput')) { window.ybAddressBar = new YBAddressBar(); } else { setTimeout(initMod, 500); } } setTimeout(initMod, 500);
-
@aminought said in Address Bar like in Yandex Browser:
UPD 3/23/2024:
- Fixed domain extraction for chrome extensions.
regarding this fix I had an idea. It's possible to display the extension name, instead of 'extension'.
Therefore I've updated the code of
#parseUrlDomain
and made the function#createYBDomainButton
async
as well.async #parseUrlDomain(url) { if (url.startsWith('vivaldi://')) { const domain = this.#parseVivaldiDomain(url); return {type: 'vivaldi', domain: domain, clickable: true}; } else if (url.startsWith('file://')) { return {type: 'file', domain: 'file', clickable: false}; } else if (url.startsWith('about:')) { return {type: 'about', domain: url, clickable: true}; } else if (url.startsWith('chrome-extension://')) { let extension = await chrome.management.get(url.match(/chrome-extension:\/\/([^/]+)/)[1]); return {type: 'extension', domain: extension.name, clickable: false}; } else { return {type: 'url', domain: url, clickable: true}; } }
-
Love this tbh, I think Vivaldi should integrate this in the browser as an option that the user can enable or disable
-
Hi,is there a CSS version for this?
-
@mrjimshim No, that's impossible
-
@aminought Ohhh okayy thanks for the reply
-
@aminought How do you turn on accent from page mine doesn't seem to work( I user vertical tabs), also do you need this mod along with ribbon theme mod? If I'm right this is one functionality from Ribbon theme
-
@oneakira said in Address Bar like in Yandex Browser:
@aminought How do you turn on accent from page mine doesn't seem to work( I user vertical tabs), also do you need this mod along with ribbon theme mod? If I'm right this is one functionality from Ribbon theme
Nevermind, Figured it out. It's in themes section in settings, it looks very bad when used with vertical tabs.