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

Side by Side Diff: chrome/common/extensions/docs/server2/templates/articles/app_external.html

Issue 10834261: Move chrome.experimental.app.onLaunched event handler to chrome.app.runtime.onLaunched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another merge before retrying commit. Created 8 years, 4 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
1 <h1>Embed Content</h1> 1 <h1>Embed Content</h1>
2 2
3 3
4 <p> 4 <p>
5 The <a href="app_architecture.html#security">packaged apps security model</a> di sallows 5 The <a href="app_architecture.html#security">packaged apps security model</a> di sallows
6 external content in iframes and 6 external content in iframes and
7 the use of inline scripting and <code>eval()</code>. 7 the use of inline scripting and <code>eval()</code>.
8 You can override these restrictions, 8 You can override these restrictions,
9 but your external content must be isolated from the app. 9 but your external content must be isolated from the app.
10 </p> 10 </p>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 <p> 173 <p>
174 Just like any other app pages, 174 Just like any other app pages,
175 you can create a window that the sandboxed page opens in. 175 you can create a window that the sandboxed page opens in.
176 Here's a sample that creates two windows, 176 Here's a sample that creates two windows,
177 one for the main app window that isn't sandboxed, 177 one for the main app window that isn't sandboxed,
178 and one for the sandboxed page: 178 and one for the sandboxed page:
179 </p> 179 </p>
180 180
181 <pre> 181 <pre>
182 chrome.experimental.app.onLaunched.addListener(function() { 182 chrome.app.runtime.onLaunched.addListener(function() {
183 chrome.app.window.create('window.html', { 183 chrome.app.window.create('window.html', {
184 'width': 400, 184 'width': 400,
185 'height': 400, 185 'height': 400,
186 'left': 0, 186 'left': 0,
187 'top': 0 187 'top': 0
188 }); 188 });
189 189
190 chrome.app.window.create('sandboxed.html', { 190 chrome.app.window.create('sandboxed.html', {
191 'width': 400, 191 'width': 400,
192 'height': 400, 192 'height': 400,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 You can use <code>postMessage</code> to communicate 229 You can use <code>postMessage</code> to communicate
230 between your app and sandboxed content. 230 between your app and sandboxed content.
231 Here's a sample background script 231 Here's a sample background script
232 that posts a message to the sandboxed page it 232 that posts a message to the sandboxed page it
233 opens: 233 opens:
234 </p> 234 </p>
235 235
236 <pre> 236 <pre>
237 var myWin = null; 237 var myWin = null;
238 238
239 chrome.experimental.app.onLaunched.addListener(function() { 239 chrome.app.runtime.onLaunched.addListener(function() {
240 chrome.app.window.create('sandboxed.html', { 240 chrome.app.window.create('sandboxed.html', {
241 'width': 400, 241 'width': 400,
242 'height': 400 242 'height': 400
243 }, function(win) { 243 }, function(win) {
244 myWin = win; 244 myWin = win;
245 myWin.postMessage('Just wanted to say hey.', '*'); 245 myWin.postMessage('Just wanted to say hey.', '*');
246 }); 246 });
247 }); 247 });
248 </pre> 248 </pre>
249 249
(...skipping 22 matching lines...) Expand all
272 272
273 <pre> 273 <pre>
274 var messageHandler = function(e) { 274 var messageHandler = function(e) {
275 console.log('Background script says hello.', e.data); 275 console.log('Background script says hello.', e.data);
276 }; 276 };
277 277
278 window.addEventListener('message', messageHandler); 278 window.addEventListener('message', messageHandler);
279 </pre> 279 </pre>
280 280
281 <p class="backtotop"><a href="#top">Back to top</a></p> 281 <p class="backtotop"><a href="#top">Back to top</a></p>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | chrome/common/extensions/docs/server2/templates/articles/app_intents.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698