Permalink
Browse files

Simple fullscreen sample.

  • Loading branch information...
scheib committed Nov 26, 2012
1 parent 12e81cd commit 34903779aee6373d015dec85a6e96a9b7ba36db8
View
@@ -0,0 +1,9 @@
+# Fullscreen sample
+
+This is a basic test of using the HTML fullscreen api to cause a window to go
+full screen.
+
+## Resources
+
+* [Fullscreen Specification](http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html)
+
View
@@ -0,0 +1,3 @@
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.app.window.create('window.html', {width: 500, height: 309});
+});
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,14 @@
+{
+ "manifest_version": 2,
+ "name": "Fullscreen sample",
+ "version": "1",
+ "icons": {
+ "16": "icon_16.png",
+ "128": "icon_128.png"
+ },
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
+ }
+}
View
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+ <h1>Fullscreen sample</h1>
+ <button id="enter">Enter Fullscreen</button>
+ <button id="exit">Exit Fullscreen</button>
+ <script src="window.js"></script>
+</body>
+</html>
View
@@ -0,0 +1,23 @@
+// Log events:
+
+document.onwebkitfullscreenchange = function () {
+ console.log("onwebkitfullscreenchange");
+}
+
+document.onwebkitfullscreenerror = function () {
+ console.log("onwebkitfullscreenerror");
+}
+
+// Button handlers:
+
+document.getElementById('enter').addEventListener('click', function(e) {
+ document.body.webkitRequestFullscreen();
+});
+
+document.getElementById('exit').addEventListener('click', function(e) {
+ document.webkitExitFullscreen();
+});
+
+// Attempt fullscreen on window creation.
+document.body.webkitRequestFullscreen();
+

0 comments on commit 3490377

Please sign in to comment.