Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Side by Side Diff: chrome/common/extensions/docs/examples/howto/sandbox/eventpage.js

Issue 10810054: Describing the `sandbox` workflow for extension developers. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 chrome.browserAction.onClicked.addListener(function() {
6 var iframe = document.getElementById('theFrame');
7 var message = {
8 command: 'render',
9 context: {thing: 'world'}
10 };
11 iframe.contentWindow.postMessage(message, '*');
12 });
13
14
15 window.addEventListener('message', function(event) {
16 if (event.data.html) {
17 var notification = webkitNotifications.createNotification(
18 'icon.png',
19 'Templated!',
20 'HTML Received for "' + event.data.name + '": `' + event.data.html + '`'
21 );
22 notification.show();
23 }
24 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698