Skip to content

Instantly share code, notes, and snippets.

@Madis0
Last active April 15, 2018 23:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Madis0/e62acaa14b18913467182f435e094d95 to your computer and use it in GitHub Desktop.
Save Madis0/e62acaa14b18913467182f435e094d95 to your computer and use it in GitHub Desktop.
<?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 {
let url = this._value
if (url.startsWith("https")) {
url = url.slice(8);
if (url.startsWith("www")) {
url = url.slice(4);
}
}
textNode.textContent = url;
} catch (err) {}
]]></body>
</method>
</implementation>
</binding>
</bindings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment