neovov / Fullscreen-API-Polyfill

MIT License
64 stars 17 forks source link

document.fullscreenElement is always true in Opera 12.12 #3

Closed Yaffle closed 11 years ago

Yaffle commented 11 years ago

Opera 12.12 uses "w3c" api, so this polyfill is not applied, but it will be good to fix this issue

workaround:

    Object.defineProperty(document, "fullscreenEnabled", {
      get: function () {
        return !!document.fullscreenElement;
      }
    });
neovov commented 11 years ago

Hi,

Thanks for the incoming. According to the spec (http://www.w3.org/TR/fullscreen/) the “fullscreenEnabled” property reflect the ability for the browser to fullscreen an element (“Returns true if document has the ability to display elements fullscreen, or false otherwise.”).

So, this is a normal workaround for Opera. I have updated the example page by using fullscreenElement instead of fullscreenEnabled for checking if we are in fullscreen or not. (commit:b4f02fe7cb)

This issue let me fix another issue regarding browsers natively supporting the API (commit:56b762bd0b)

Cheers!