Skip to content
Browse files

Renamed main html and js, added icon, added readme

  • Loading branch information...
1 parent 5a6b7e0 commit 991cdc01db79e7bb4fea85b00496653984fe79a4 @paullewis paullewis committed Aug 9, 2012
View
23 sandbox/README.md
@@ -0,0 +1,23 @@
+# Sandbox
+
+This sample creates a sandboxed iframe (`sandbox.html`) to which the main page (`mainpage.html`)
+passes a counter variable. The sandboxed page uses handlebars to evaluate and compose a message
+using the counter variable which is then passed back to the main page for rendering.
+
+[CSP](http://developer.chrome.com/trunk/apps/app_csp.html) disallows the use
+of `eval` or `new Function` (or variations like Function.apply) so using a
+sandbox is necessary for this process. To enable sandboxing in your app you
+add the `sandbox` property to your app's [manifest file](http://code.google.com/chrome/extensions/manifest.html#sandbox).
+
+## Permissions
+
+* Experimental
+
+[See more on permissions](http://code.google.com/chrome/extensions/manifest.html#permissions)
+
+## APIs
+
+* [Experimental App](http://developer.chrome.com/trunk/apps/experimental.app.html)
+
+---
+Last updated: 2012-08-09 by paullewis
View
BIN sandbox/icon.png
Deleted file not rendered
View
BIN sandbox/icon_128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 sandbox/main.js
@@ -5,6 +5,6 @@
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
chrome.experimental.app.onLaunched.addListener(function() {
- chrome.app.window.create('eventpage.html',
+ chrome.app.window.create('mainpage.html',
{width: 500, height: 309});
});
View
2 sandbox/eventpage.html → sandbox/mainpage.html
@@ -6,7 +6,7 @@
<!doctype html>
<html>
<head>
- <script src="eventpage.js"></script>
+ <script src="mainpage.js"></script>
</head>
<body>
<button id="sendMessage">Click me</button>
View
0 sandbox/eventpage.js → sandbox/mainpage.js
File renamed without changes.
View
4 sandbox/manifest.json
@@ -1,6 +1,6 @@
{
"name": "Sandboxed Frame",
- "version": "1.0",
+ "version": "1.0.1",
"manifest_version": 2,
"permissions": ["experimental"],
"app": {
@@ -9,7 +9,7 @@
}
},
"icons": {
- "128": "icon.png"
+ "128": "icon_128.png"
},
"sandbox": {
"pages": ["sandbox.html"]
View
6 sandbox/sandbox.html
@@ -14,7 +14,7 @@
<div class="entry">
<h1>Hello</h1>
<p>This is a Handlebar template compiled inside a hidden sandboxed iframe.<br/>
- The counter parameter from postMessage (outter frame) is: {{counter}}</p>
+ The counter parameter from postMessage (outter frame) is: {{counter}}</p>
</p>
</div>
</script>
@@ -23,7 +23,7 @@
<div class="entry">
<h1>Welcome back</h1>
<p>This is another Handlebar template compiled inside a hidden sandboxed iframe.<br/>
- The counter parameter from postMessage (outter frame) is: {{counter}}</p>
+ The counter parameter from postMessage (outter frame) is: {{counter}}</p>
</p>
</div>
</script>
@@ -42,7 +42,7 @@
// Set up message event handler:
window.addEventListener('message', function(event) {
- var command = event.data.command,
+ var command = event.data.command,
template = templates[event.data.templateName],
result = "invalid request";

0 comments on commit 991cdc0

Please sign in to comment.
Something went wrong with that request. Please try again.