I was working on a toolbar plugin where I accidentally named the plugin object 'toolbar'. And when I wanted to working on it in my console, I accidentally wanted to get the value of my toolbar object (without calling it actually), but it returned something called BarProp
and the result was something like this
I checked the typeof
and typeof BarProp.valueOf()
, where both of these returned that it's a function
type.
I've searched for additional information on 'What actually is BarProp?', but I found nothing much than this msdn documentation : documentation_link
My questions are - What is this BarProp? What's it's purpose? How can we use it?
In short
The visible attribute, on getting, must return either true or a value determined by the user agent to most accurately represent the visibility state of the user interface element that the object represents, as described below. On setting, the new value must be discarded.
In more detail
From MSDN docs
From W3: https://www.w3.org/TR/2009/WD-html5-20090212/browsers.html
To allow Web pages to integrate with Web browsers, certain Web browser interface elements are exposed in a limited way to scripts in Web pages.
Each interface element is represented by a BarProp object:
interface BarProp { attribute boolean visible; }; The visible attribute, on getting, must return either true or a value determined by the user agent to most accurately represent the visibility state of the user interface element that the object represents, as described below. On setting, the new value must be discarded.
The following BarProp objects exist for each Document object in a browsing context. Some of the user interface elements represented by these objects might have no equivalent in some user agents; for those user agents, unless otherwise specified, the object must act as if it was present and visible (i.e. its visible attribute must return true).
The location bar BarProp object Represents the user interface element that contains a control that displays the URL of the active document, or some similar interface concept. The menu bar BarProp object Represents the user interface element that contains a list of commands in menu form, or some similar interface concept. The personal bar BarProp object Represents the user interface element that contains links to the user's favorite pages, or some similar interface concept. The scrollbar BarProp object Represents the user interface element that contains a scrolling mechanism, or some similar interface concept. The status bar BarProp object Represents a user interface element found immediately below or after the document, as appropriate for the default view's media. If the user agent has no such user interface element, then the object may act as if the corresponding user interface element was absent (i.e. its visible attribute may return false). The tool bar BarProp object Represents the user interface element found immediately above or before the document, as appropriate for the default view's media. If the user agent has no such user interface element, then the object may act as if the corresponding user interface element was absent (i.e. its visible attribute may return false). The locationbar attribute must return the location bar BarProp object.
The menubar attribute must return the menu bar BarProp object.
The personalbar attribute must return the personal bar BarProp object.
The scrollbars attribute must return the scrollbar BarProp object.
The statusbar attribute must return the status bar BarProp object.
The toolbar attribute must return the tool bar BarProp object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With