MDN explains how to use the window.screen
object, but also says "DOM Level 0. Not part of specification."
W3Schools says that window.screen.*
properties are supported in all major browsers.
If I understand this correctly... window.screen
is completely non-standard, but is nonetheless universally supported. Is that right?
If this is the case, are there any cross-browser differences I need to be aware of, or can I just use it? I'm mostly interested in screen.availWidth
, by the way.
Screens don't only increase your curb appeal; when they are in good working condition and kept nice and clean, they can also help to keep your exterior window panes from getting dirty. Clean window screens won't cause dirt to splatter on your window glass.
It serves as the primary barrier between the exterior and interior of your home. Window and door screens are mandatory if you like to let fresh air into your home. Screens also protect glass and doors from abuse like a ball flying at a window from your children playing outdoors.
Your window screens are not just a barrier for sunlight but also for heat. Removing the screens will increase your solar heat absorption as well as your home's energy efficiency — giving your heating system a break and saving you money.
Quirksmode compatibility tables to the rescue!
http://www.quirksmode.org/dom/w3c_cssom.html#screenview
Most, but not all values are supported by the major browsers.
You should be fine with it.
The reason that it is not part of a standard is because DOM Level 0 was introduced before standards were around. DOM Level 0 is also called the Legacy DOM, and it was created at the same time NetScape 2.0 made JavaScript in the browser a reality; in effect, DOM Level 0 was the very first DOM spec.
The Legacy DOM will be around for a long time, if not then it would break backward compatibility with a TON of very popular scripts already in existence.
EDIT: In other words, your understanding is completely correct. It is not "standardized" but it is completely universal and will remain so for a long time.
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