Quicksaver
2014-01-25 13:40:10 UTC
Hi everyone, I was hoping someone could help me with a kind of a big
problem I just can't figure out.
I need to know, for my add-on, whether the scrollbar of a tab is on the
right or on the left of the window. If the preference
layout.scrollbar.side is 2 (right) or 3 (left) that is easy of course.
But if it is 1 (content) I'm having doubts about how I'm doing it
currently, as I'm just checking for contentDocument.documentElement.dir
== 'rtl' of each browser and I'm not sure if that gives me reliable
results 100% of the time.
And the biggest problem I have is when the pref is 0 (browser UI,
default). I have no idea of what I should be checking for in this case.
All of the methods in the Services.locale object can somehow be tricked
into returning one of the rtl locales by changing my OS settings, and
still keep the scrollbar on the right. In addition, I can also keep the
scrollbar on the right even when using a rtl localization of firefox.
Thus, pretty much every check I've come up with returns the rtl locale
"correctly", despite the location of the scrollbar still being on the right.
So, does anyone know of any way to always accurately get the location of
the scrollbar? Maybe I'm missing something really simple and obvious,
but like I said, I just can't figure it out. I'd really appreciate any
kind of help with this.
Luís Miguel
problem I just can't figure out.
I need to know, for my add-on, whether the scrollbar of a tab is on the
right or on the left of the window. If the preference
layout.scrollbar.side is 2 (right) or 3 (left) that is easy of course.
But if it is 1 (content) I'm having doubts about how I'm doing it
currently, as I'm just checking for contentDocument.documentElement.dir
== 'rtl' of each browser and I'm not sure if that gives me reliable
results 100% of the time.
And the biggest problem I have is when the pref is 0 (browser UI,
default). I have no idea of what I should be checking for in this case.
All of the methods in the Services.locale object can somehow be tricked
into returning one of the rtl locales by changing my OS settings, and
still keep the scrollbar on the right. In addition, I can also keep the
scrollbar on the right even when using a rtl localization of firefox.
Thus, pretty much every check I've come up with returns the rtl locale
"correctly", despite the location of the scrollbar still being on the right.
So, does anyone know of any way to always accurately get the location of
the scrollbar? Maybe I'm missing something really simple and obvious,
but like I said, I just can't figure it out. I'd really appreciate any
kind of help with this.
Luís Miguel