Last active
August 6, 2018 12:46
-
-
Save hensm/f1e28acd25e072acb63867ba6bc7b365 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE bindings> | |
<bindings xmlns="http://www.mozilla.org/xbl"> | |
<binding id="urlbar" extends="chrome://browser/content/urlbarBindings.xml#urlbar"> | |
<implementation> | |
<method name="formatValue"> | |
<body><![CDATA[ | |
const textNode = this.editor.rootElement.firstChild; | |
if (this.focused) return; | |
try { | |
const url = new URL(this._value); | |
if (/(http|https):/.test(url.protocol)) { | |
if (url.host.startsWith("www")) { | |
url.host = url.host.slice(4); | |
} | |
textNode.textContent = url.host; | |
} | |
} catch (err) {} | |
]]></body> | |
</method> | |
</implementation> | |
</binding> | |
</bindings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#urlbar { | |
/* Place bindings.xml in the same folder as userChrome.css */ | |
-moz-binding: url("bindings.xml#urlbar") !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Thanks so much for this! This is great :D
I was just wondering if you had any idea why this caused a bar to pop up at the top of the window?
I must admit, I would love it to look like the picture below:
This black bar on top is apparently caused by this url trick, as it disappears when removing your css snipet from userChrome.css
It looks so cool though, I'd love to have both the address bar show only the domain, and no black bar on top :P Hopefully you have some advice for this?
Anyway, thanks again, it's really cool 👌
Have nice day ^^
EDIT : Somehow, setting a custom URL as destination for opening new windows corrects this. I have no idea why, but it does.