_This issue was originally filed by @pjako_
Currently you can't get fullscreen to work in firefox, with a polyfill we could fix this.
See:
https://github.com/neovov/Fullscreen-API-Polyfill
_Removed Type-Defect label._
_Added Type-Enhancement, Area-DOM, Triaged labels._
_Added this to the Later milestone._
_This comment was originally written by @bp74_
The following issues are the same: 4136, 10246 and 11506
Even Internet Explorer 11 supports the full-screen API. It would be great if dart2js could provide a polyfill to support all browsers (like it does with requestAnimationFrame).
_Removed Area-HTML label._
_Added Area-Library, Library-Html labels._
_Removed this from the Later milestone._
_Added Oldschool-Milestone-Later label._
_Removed Oldschool-Milestone-Later label._
Issue #11506 has been merged into this issue.
Issue #10246 has been merged into this issue.
Issue #20667 has been merged into this issue.
_This comment was originally written by @sethladd_
Is there a workaround for this, until the engineers get to addressing this?
_This comment was originally written by this.is.harry....@gmail.com_
Here's a workaround function you can use instead of calling requestFullScreen. You can do something similar with requestPointerLock.
import 'dart:js';
void fullscreenWorkaround(CanvasElement canvas) {
var canv = new JsObject.fromBrowserObject(canvas);
if (canv.hasProperty("requestFullscreen")) {
canv.callMethod("requestFullscreen");
}
else {
List<String> vendors = ['moz', 'webkit', 'ms', 'o'];
for (String vendor in vendors) {
String vendorFullscreen = "${vendor}RequestFullscreen";
if (vendor == 'moz') {
vendorFullscreen = "${vendor}RequestFullScreen";
}
if (canv.hasProperty(vendorFullscreen)) {
canv.callMethod(vendorFullscreen);
return;
}
}
}
}
This seems like a defect if the API exists but doesn't work uniformly.
_Set owner to @alan-knight._
_Removed Type-Enhancement label._
_Added Type-Defect label._
_This comment was originally written by this.is.harry.ster...@gmail.com_
The fullscreen API currently specifies (https://fullscreen.spec.whatwg.org/#api) the following elements, all of which need to be polyfilled in order for the API to work uniformly.
partial interface Element {
void requestFullscreen();
};
partial interface Document {
readonly attribute boolean fullscreenEnabled;
readonly attribute Element? fullscreenElement;
void exitFullscreen();
attribute EventHandler onfullscreenchange;
attribute EventHandler onfullscreenerror;
};
The workaround code I posted above was taken essentially verbatim from the dart2js code for requestAnimationFrame, (https://dart.googlecode.com/svn/trunk/dart/sdk/lib/html/dart2js/html_dart2js.dart line 30082).
The same problem exists with the pointer lock API. See bug 4463.
_This comment was originally written by joo...@gmail.com_
requestFullscreen not work.
dart sdk: 1.8.5, run on chrome 40 by dart2js.
show error message:
NoSuchMethodError: undefined is not a function
please, fix this.
_Removed Priority-Medium label._
_Added Priority-High label._
_Added this to the 1.10 milestone._
This might still be relevant.
Please, provide a polyfill to support by dart2js.
It's been five years and yet still in 2017 attempting to call the requestFullscreen() function on an html element in dart code results in a NoSuchMethodError in Chrome.
Why not just remove the functions from dart:html if they can't be provided? It seems worse to provide implementations that don't work because the library is actively advertising functionality it can't provide with no indication that the problem is actually in dart:html rather than the user's code.
Totally agree, @ajrcarey. We're in the middle of a very deliberate refactoring of Dart tools towards v2 鈥撀爏ee here http://news.dartlang.org/2017/06/a-stronger-dart-for-everyone.html
There are a number of APIs in dart:html that need to be fixed/removed. We haven't lost track of these...
Thanks for your patience...
_Edited by moderator_.
There are no plans to add additional polyfills to Dart2JS.
Not a polyfill, but as far as working in Chrome that looks like #21919
Most helpful comment
It's been five years and yet still in 2017 attempting to call the requestFullscreen() function on an html element in dart code results in a NoSuchMethodError in Chrome.
Why not just remove the functions from dart:html if they can't be provided? It seems worse to provide implementations that don't work because the library is actively advertising functionality it can't provide with no indication that the problem is actually in dart:html rather than the user's code.