=====
var url = document.commandDispatcher.focusedWindow.location;
return ( url.protocol == "http:" || url.protocol == "https:" );
=====
But it doesn't work, if focused window is URL bar, Search bar or something
like this. It is not what I want: in such case command is enabled too, of
course. How could IO get URL of docuement in active (or only one) tab in
FF and Mozilla?
Lev Serebryakov
Programmer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
> To enable/disable my command I need to be sure, that current
> document has `http://...' URL.
> Now I'm detecting this like this:
>
> =====
> var url = document.commandDispatcher.focusedWindow.location;
> return ( url.protocol == "http:" || url.protocol == "https:" );
> =====
>
> But it doesn't work, if focused window is URL bar, Search bar or
> something like this. It is not what I want: in such case command is
> enabled too, of course. How could IO get URL of docuement in active
> (or only one) tab in FF and Mozilla?
Well, the correct way is getBrowser().currentURI.schemeIs("http") ||
getBrowser().currentURI.schemeIs("https"); but the error with your code
is that you wanted content.location.protocol
--
Warning: May contain traces of nuts.