Permalink
Browse files

Simplified example, added readme

  • Loading branch information...
1 parent 82a3ce7 commit 1b947f107d92c493e1c33dfd34179f1c0fbe4722 @paullewis paullewis committed Aug 10, 2012
@@ -1,15 +0,0 @@
-chrome.experimental.app.onLaunched.addListener(function() {
- chrome.app.window.create('main.html', {
- 'width': 400,
- 'height': 400,
- 'left': 0,
- 'top': 0
- });
-
- chrome.app.window.create('sandboxed.html', {
- 'width': 400,
- 'height': 400,
- 'left': 400,
- 'top': 0
- });
-});
@@ -1,12 +1,13 @@
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8" />
- <title>Sandboxed content</title>
+ <meta charset="utf-8">
+ <title>Sandboxed Content</title>
+ <link rel="stylesheet" href="styles/main.css">
</head>
<body>
-<p>I am normal app window.</p>
-
-<iframe src="sandboxed.html" width="300" height="200"></iframe>
+ <h1>Main Window</h1>
+ <p>I am the main window. I am not sandboxed.</p>
+ <iframe src="sandboxed.html" width="380" height="140"></iframe>
</body>
</html>
@@ -0,0 +1,6 @@
+chrome.experimental.app.onLaunched.addListener(function() {
+ chrome.app.window.create('main.html', {
+ 'width': 400,
+ 'height': 400
+ });
+});
@@ -4,7 +4,7 @@
"manifest_version": 2,
"app": {
"background": {
- "scripts": ["background.js"]
+ "scripts": ["main.js"]
}
},
"permissions": [
@@ -1,3 +0,0 @@
-h1 {
- color: red;
-}
@@ -1,10 +1,17 @@
+<!DOCTYPE html>
<html>
- <link rel="stylesheet" href="/sandboxed.css" />
- <body>
- <h1>Woot</h1>
+<head>
+ <meta charset="utf-8">
+ <title>Sandboxed Content</title>
+ <link rel="stylesheet" href="styles/main.css">
+</head>
+<body>
+ <h1>Sandboxed Content</h1>
+ <p>I am the sandboxed iframe.</p>
+ <div id="message"></div>
<script>
- document.write('I am an inline script.<br>');
- eval('document.write(\'I am an eval-ed inline script.\');');
+ eval('document.getElementById(\'message\').innerHTML = \'<p>I am the ' +
+ 'output of an eval-ed inline script.</p>\'');
</script>
- </body>
+</body>
</html>
@@ -0,0 +1,18 @@
+html, body {
+ font-family: Helvetica, Arial;
+ color: #444;
+}
+
+h1 {
+ margin: 0 0 0.3em 0;
+}
+
+p {
+ color: #888;
+ margin: 0 0 1em 0;
+}
+
+iframe {
+ border: 1px solid #CCC;
+ margin-top: 20px;
+}

0 comments on commit 1b947f1

Please sign in to comment.