MozillaZine

Change default text direction in URL bar

Talk about add-ons and extension development.
Yaron10
 
Posts: 447
Joined: July 5th, 2011, 6:32 am

Post Posted December 17th, 2018, 3:30 pm

In earlier Firefox versions I was able to change the default text direction in the URL bar (from right to left, in FF RTL locals) by modifying the following code in chrome\toolkit\res\forms.css:

Code: Select all
@-moz-document url-prefix(chrome://) {
  input.uri-element-right-align:-moz-locale-dir(rtl) {
    direction: ltr !important;
    text-align: right !important;
  }

  Make sure that the location bar's alignment in RTL mode changes according
     to the input box direction if the user switches the text direction using
     cmd_switchTextDirection (which applies a dir attribute to the <input>).
  input.uri-element-right-align[dir=ltr]:-moz-locale-dir(rtl) {
    text-align: left !important;
  }
}


Could anyone please refer me to the relevant code in Firefox 64?
I'd appreciate your help.

Yaron10
 
Posts: 447
Joined: July 5th, 2011, 6:32 am

Post Posted December 17th, 2018, 6:09 pm

The relevant code is in chrome\browser\content\browser\browser.css.

Code: Select all
/* Display URLs left-to-right but right aligned in RTL mode. */
html|input.urlbar-input:-moz-locale-dir(rtl) {
  direction: ltr !important;
  text-align: right !important;
}

/* Make sure that the location bar's alignment in RTL mode changes according
   to the input box direction if the user switches the text direction using
   cmd_switchTextDirection (which applies a dir attribute to the <input>). */
html|input.urlbar-input[dir=ltr]:-moz-locale-dir(rtl) {
  text-align: left !important;
}

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 5 guests