OLD | NEW |
| (Empty) |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | |
2 1) The <head> information in this page is significant, should be uniform | |
3 across api docs and should be edited only with knowledge of the | |
4 templating mechanism. | |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | |
6 browser, it will be re-generated from the template, json schema and | |
7 authored overview content. | |
8 4) The <body>.innerHTML is also generated by an offline step so that this | |
9 page may easily be indexed by search engines. | |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | |
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | |
15 </script> | |
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
17 </script> | |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
20 <script type="text/javascript" src="js/sidebar.js"></script> | |
21 <meta name="description" content="Documentation for the chrome.experimental.ma
nagedMode module, which is part of the Google Chrome extension APIs."><title>Ma
naged Mode API - Google Chrome Extensions - Google Code</title></head> | |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
24 </div> | |
25 <div id="branchWarning" class="displayModeWarning"> | |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
27 It may not work with the stable release of Chrome.</span> | |
28 <select id="branchChooser"> | |
29 <option>Choose a different version... | |
30 </option><option value="">Stable | |
31 </option><option value="beta">Beta | |
32 </option><option value="dev">Dev | |
33 </option><option value="trunk">Trunk | |
34 </option></select> | |
35 </div> | |
36 <div id="unofficialWarning" class="displayModeWarning"> | |
37 <span>WARNING: This is unofficial documentation. It may not work with the | |
38 current release of Chrome.</span> | |
39 <button id="goToOfficialDocs">Go to the official docs</button> | |
40 </div> | |
41 <div id="gc-container" class="labs"> | |
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
44 jstemplate to make a copy of the template in this section which | |
45 are not operated on by way of the jsskip="true" --> | |
46 <!-- /SUBTEMPLATES --> | |
47 <a id="top"></a> | |
48 <div id="skipto"> | |
49 <a href="#gc-pagecontent">Skip to page content</a> | |
50 <a href="#gc-toc">Skip to main navigation</a> | |
51 </div> | |
52 <!-- API HEADER --> | |
53 <table id="header" width="100%" cellspacing="0" border="0"> | |
54 <tbody><tr> | |
55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
58 <div id="gsc-search-box"> | |
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
60 <input type="hidden" name="ie" value="UTF-8"> | |
61 <input type="text" name="q" value="" size="55"> | |
62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
63 <br> | |
64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
65 </div> | |
66 </form> | |
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
71 </td> | |
72 </tr> | |
73 </tbody></table> | |
74 <div id="codesiteContent" class=""> | |
75 <a id="gc-topnav-anchor"></a> | |
76 <div id="gc-topnav"> | |
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
78 <ul id="home" class="gc-topnav-tabs"> | |
79 <li id="home_link"> | |
80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
81 </li> | |
82 <li id="docs_link"> | |
83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
84 </li> | |
85 <li id="faq_link"> | |
86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
87 </li> | |
88 <li id="samples_link"> | |
89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
90 </li> | |
91 <li id="group_link"> | |
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
93 </li> | |
94 <li id="so_link"> | |
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
96 </li> | |
97 </ul> | |
98 </div> <!-- end gc-topnav --> | |
99 <div class="g-section g-tpl-170"> | |
100 <!-- SIDENAV --> | |
101 <div class="g-unit g-first" id="gc-toc"> | |
102 <ul> | |
103 <li><a href="getstarted.html">Getting Started</a></li> | |
104 <li><a href="overview.html">Overview</a></li> | |
105 <li><a href="whats_new.html">What's New?</a></li> | |
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
107 <ul> | |
108 <li>Browser UI | |
109 <ul> | |
110 <li><a href="browserAction.html">Browser Actions</a></li> | |
111 <li><a href="contextMenus.html">Context Menus</a></li> | |
112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
113 <li><a href="omnibox.html">Omnibox</a></li> | |
114 <li><a href="options.html">Options Pages</a></li> | |
115 <li><a href="override.html">Override Pages</a></li> | |
116 <li><a href="pageAction.html">Page Actions</a></li> | |
117 </ul> | |
118 </li> | |
119 <li>Browser Interaction | |
120 <ul> | |
121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
122 <li><a href="cookies.html">Cookies</a></li> | |
123 <li><a href="devtools.html">Developer Tools</a></li> | |
124 <li><a href="events.html">Events</a></li> | |
125 <li><a href="history.html">History</a></li> | |
126 <li><a href="management.html">Management</a></li> | |
127 <li><a href="tabs.html">Tabs</a></li> | |
128 <li><a href="windows.html">Windows</a></li> | |
129 </ul> | |
130 </li> | |
131 <li>Implementation | |
132 <ul> | |
133 <li><a href="a11y.html">Accessibility</a></li> | |
134 <li><a href="background_pages.html">Background Pages</a></li> | |
135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
137 <li><a href="i18n.html">Internationalization</a></li> | |
138 <li><a href="messaging.html">Message Passing</a></li> | |
139 <li><a href="permissions.html">Optional Permissions</a></li> | |
140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
141 </ul> | |
142 </li> | |
143 <li>Finishing | |
144 <ul> | |
145 <li><a href="hosting.html">Hosting</a></li> | |
146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
147 </ul> | |
148 </li> | |
149 </ul> | |
150 </li> | |
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
153 <ul> | |
154 <li><a href="tut_debugging.html">Debugging</a></li> | |
155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
156 <li><a href="tut_oauth.html">OAuth</a></li> | |
157 </ul> | |
158 </li> | |
159 <li><h2>Reference</h2> | |
160 <ul> | |
161 <li>Formats | |
162 <ul> | |
163 <li><a href="manifest.html">Manifest Files</a></li> | |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
165 </ul> | |
166 </li> | |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
169 <li><a href="api_other.html">Other APIs</a></li> | |
170 </ul> | |
171 </li> | |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
173 <div class="line"> </div> | |
174 <li><h2>More</h2> | |
175 <ul> | |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
178 <li><a href="themes.html">Themes</a></li> | |
179 </ul> | |
180 </li> | |
181 </ul> | |
182 </div> | |
183 <script> | |
184 initToggles(); | |
185 </script> | |
186 <div class="g-unit" id="gc-pagecontent"> | |
187 <div id="pageTitle"> | |
188 <h1 class="page_title">Managed Mode API</h1> | |
189 </div> | |
190 <!-- TABLE OF CONTENTS --> | |
191 <div id="toc"> | |
192 <h2>Contents</h2> | |
193 <ol> | |
194 <li> | |
195 <a href="#manifest">Manifest</a> | |
196 <ol> | |
197 </ol> | |
198 </li><li> | |
199 <a href="#about">About Managed Mode</a> | |
200 <ol> | |
201 </ol> | |
202 </li><li> | |
203 <a href="#usage">Usage</a> | |
204 <ol> | |
205 </ol> | |
206 </li> | |
207 <li> | |
208 <a href="#apiReference">API reference: chrome.experimental.manag
edMode</a> | |
209 <ol> | |
210 <li> | |
211 <a href="#global-methods">Methods</a> | |
212 <ol> | |
213 <li> | |
214 <a href="#method-enter">enter</a> | |
215 </li><li> | |
216 <a href="#method-get">get</a> | |
217 </li> | |
218 </ol> | |
219 </li> | |
220 </ol> | |
221 </li> | |
222 </ol> | |
223 </div> | |
224 <!-- /TABLE OF CONTENTS --> | |
225 <!-- Standard content lead-in for experimental API pages --> | |
226 <!-- STATIC CONTENT PLACEHOLDER --> | |
227 <div id="static"><div id="pageData-name" class="pageData">Managed Mode A
PI</div> | |
228 <!-- BEGIN AUTHORED CONTENT --> | |
229 <p id="classSummary"> | |
230 The <code>chrome.experimental.managedMode</code> module allows extensions to | |
231 request that the browser enter managed mode, as well as to query whether it | |
232 is currently in managed mode. | |
233 </p> | |
234 <p class="note"> | |
235 <b>Note: </b>Extensions cannot request that the browser leave managed mode. | |
236 This must be done by the user from within the browser itself. | |
237 </p> | |
238 <h2 id="manifest">Manifest</h2> | |
239 <p> | |
240 You must declare the "managedMode" and "experimental" permissions in your | |
241 extension's <a href="manifest.html">manifest</a> to use the API. For example: | |
242 </p> | |
243 <pre>{ | |
244 "name": "My extension", | |
245 ... | |
246 <b>"permissions": [ | |
247 "experimental", | |
248 "managedMode" | |
249 ]</b>, | |
250 ... | |
251 }</pre> | |
252 <h2 id="about">About Managed Mode</h2> | |
253 <p> | |
254 Managed mode allows one person to manage the Chrome experience for another | |
255 person by pre-configuring and then locking a managed User profile. | |
256 <span class="todo">For more information about Chrome's managed mode, see | |
257 <b>[TBD]</b>.</span> | |
258 </p> | |
259 <h2 id="usage">Usage</h2> | |
260 <p> | |
261 Querying managed mode is straightforward. Simply call <code>get()</code>, | |
262 providing a callback function to receive the result. For example: | |
263 </p> | |
264 <pre>chrome.experimental.managedMode.get(function(details) { | |
265 if (details.value) | |
266 console.log('Managed mode is on.'); | |
267 else | |
268 console.log('Managed mode is off.'); | |
269 });</pre> | |
270 <p> | |
271 Entering managed mode is a little bit more complex, because if the browser is | |
272 already in managed mode, trying to enter it again will have no effect. To | |
273 avoid confusing users, it's advisable to check whether your extension can | |
274 enter managed mode (i.e., if it is not already in effect), and visually | |
275 disable the functionality in your extension if not. You can optionally | |
276 provide a callback function to <code>enter()</code> to receive the result. | |
277 For example: | |
278 </p> | |
279 <pre>chrome.experimental.managedMode.get(function(details) { | |
280 if (details.value) { | |
281 console.log("Managed mode is already in effect."); | |
282 } else { | |
283 chrome.experimental.managedMode.enter(function(result) { | |
284 if (chrome.extension.lastError === undefined) { | |
285 if (result.success) | |
286 console.log("Hooray, it worked!"); | |
287 else | |
288 console.log("Oops, the user changed her mind."); | |
289 } else { | |
290 console.log("Aw, snap!", chrome.extension.lastError); | |
291 } | |
292 }); | |
293 } | |
294 });</pre> | |
295 <!-- END AUTHORED CONTENT --> | |
296 </div> | |
297 <!-- API PAGE --> | |
298 <div class="apiPage"> | |
299 <a name="apiReference"></a> | |
300 <h2>API reference: chrome.experimental.managedMode</h2> | |
301 <!-- PROPERTIES --> | |
302 <!-- /apiGroup --> | |
303 <!-- METHODS --> | |
304 <div id="methodsTemplate" class="apiGroup"> | |
305 <a name="global-methods"></a> | |
306 <h3>Methods</h3> | |
307 <!-- iterates over all functions --> | |
308 <div class="apiItem"> | |
309 <a name="method-enter"></a> <!-- method-anchor --> | |
310 <h4>enter</h4> | |
311 <div class="summary"> | |
312 <!-- Note: intentionally longer 80 columns --> | |
313 <span>chrome.experimental.managedMode.enter</span>(<span class
="optional"><span>function</span> | |
314 <var><span>callback</span></var></span>)</div> | |
315 <div class="description"> | |
316 <p>Shows a confirmation dialog, then puts the browser into manag
ed mode. The callback parameter will be true if managed mode was entered success
fully, false if the user cancelled the confirmation. If managed mode is already
on, trying to enter it again will have no effect.</p> | |
317 <!-- PARAMETERS --> | |
318 <h4>Parameters</h4> | |
319 <dl> | |
320 <div> | |
321 <div> | |
322 <dt> | |
323 <var>callback</var> | |
324 <em> | |
325 <!-- TYPE --> | |
326 <div style="display:inline"> | |
327 ( | |
328 <span class="optional">optional</span> | |
329 <span id="typeTemplate"> | |
330 <span> | |
331 <span>function</span> | |
332 </span> | |
333 </span> | |
334 ) | |
335 </div> | |
336 </em> | |
337 </dt> | |
338 <dd class="todo"> | |
339 Undocumented. | |
340 </dd> | |
341 <!-- OBJECT PROPERTIES --> | |
342 <!-- OBJECT METHODS --> | |
343 <!-- OBJECT EVENT FIELDS --> | |
344 <!-- FUNCTION PARAMETERS --> | |
345 </div> | |
346 </div> | |
347 </dl> | |
348 <!-- RETURNS --> | |
349 <dl> | |
350 </dl> | |
351 <!-- CALLBACK --> | |
352 <div> | |
353 <div> | |
354 <h4>Callback function</h4> | |
355 <p> | |
356 If you specify the <em>callback</em> parameter, it should | |
357 specify a function that looks like this: | |
358 </p> | |
359 <!-- Note: intentionally longer 80 columns --> | |
360 <pre>function(<span>object result</span>) <span class="subdued
">{...}</span>;</pre> | |
361 <dl> | |
362 <div> | |
363 <div> | |
364 <dt> | |
365 <var>result</var> | |
366 <em> | |
367 <!-- TYPE --> | |
368 <div style="display:inline"> | |
369 ( | |
370 <span id="typeTemplate"> | |
371 <span> | |
372 <span>object</span> | |
373 </span> | |
374 </span> | |
375 ) | |
376 </div> | |
377 </em> | |
378 </dt> | |
379 <dd>The result of the attempt to enter managed mode.</dd> | |
380 <!-- OBJECT PROPERTIES --> | |
381 <dd> | |
382 <dl> | |
383 <div> | |
384 <div> | |
385 <dt> | |
386 <var>success</var> | |
387 <em> | |
388 <!-- TYPE --> | |
389 <div style="display:inline"> | |
390 ( | |
391 <span id="typeTemplate"> | |
392 <span> | |
393 <span>boolean</span> | |
394 </span> | |
395 </span> | |
396 ) | |
397 </div> | |
398 </em> | |
399 </dt> | |
400 <dd>True if managed mode was entered successfully, false if the user c
ancelled the confirmation.</dd> | |
401 <!-- OBJECT PROPERTIES --> | |
402 <!-- OBJECT METHODS --> | |
403 <!-- OBJECT EVENT FIELDS --> | |
404 <!-- FUNCTION PARAMETERS --> | |
405 </div> | |
406 </div> | |
407 </dl> | |
408 </dd> | |
409 <!-- OBJECT METHODS --> | |
410 <!-- OBJECT EVENT FIELDS --> | |
411 <!-- FUNCTION PARAMETERS --> | |
412 </div> | |
413 </div> | |
414 </dl> | |
415 </div> | |
416 </div> | |
417 <!-- MIN_VERSION --> | |
418 </div> <!-- /description --> | |
419 </div><div class="apiItem"> | |
420 <a name="method-get"></a> <!-- method-anchor --> | |
421 <h4>get</h4> | |
422 <div class="summary"> | |
423 <!-- Note: intentionally longer 80 columns --> | |
424 <span>chrome.experimental.managedMode.get</span>(<span class="
null"><span>function</span> | |
425 <var><span>callback</span></var></span>)</div> | |
426 <div class="description"> | |
427 <p>Gets the value of the setting describing whether managed mode
is in effect.</p> | |
428 <!-- PARAMETERS --> | |
429 <h4>Parameters</h4> | |
430 <dl> | |
431 <div> | |
432 <div> | |
433 <dt> | |
434 <var>callback</var> | |
435 <em> | |
436 <!-- TYPE --> | |
437 <div style="display:inline"> | |
438 ( | |
439 <span id="typeTemplate"> | |
440 <span> | |
441 <span>function</span> | |
442 </span> | |
443 </span> | |
444 ) | |
445 </div> | |
446 </em> | |
447 </dt> | |
448 <dd class="todo"> | |
449 Undocumented. | |
450 </dd> | |
451 <!-- OBJECT PROPERTIES --> | |
452 <!-- OBJECT METHODS --> | |
453 <!-- OBJECT EVENT FIELDS --> | |
454 <!-- FUNCTION PARAMETERS --> | |
455 </div> | |
456 </div> | |
457 </dl> | |
458 <!-- RETURNS --> | |
459 <dl> | |
460 </dl> | |
461 <!-- CALLBACK --> | |
462 <div> | |
463 <div> | |
464 <h4>Callback function</h4> | |
465 <p> | |
466 The callback <em>parameter</em> should specify a function | |
467 that looks like this: | |
468 </p> | |
469 <!-- Note: intentionally longer 80 columns --> | |
470 <pre>function(<span>object details</span>) <span class="subdue
d">{...}</span>;</pre> | |
471 <dl> | |
472 <div> | |
473 <div> | |
474 <dt> | |
475 <var>details</var> | |
476 <em> | |
477 <!-- TYPE --> | |
478 <div style="display:inline"> | |
479 ( | |
480 <span id="typeTemplate"> | |
481 <span> | |
482 <span>object</span> | |
483 </span> | |
484 </span> | |
485 ) | |
486 </div> | |
487 </em> | |
488 </dt> | |
489 <dd>Details of the currently effective value.</dd> | |
490 <!-- OBJECT PROPERTIES --> | |
491 <dd> | |
492 <dl> | |
493 <div> | |
494 <div> | |
495 <dt> | |
496 <var>value</var> | |
497 <em> | |
498 <!-- TYPE --> | |
499 <div style="display:inline"> | |
500 ( | |
501 <span id="typeTemplate"> | |
502 <span> | |
503 <span>boolean</span> | |
504 </span> | |
505 </span> | |
506 ) | |
507 </div> | |
508 </em> | |
509 </dt> | |
510 <dd>The value of the setting.</dd> | |
511 <!-- OBJECT PROPERTIES --> | |
512 <!-- OBJECT METHODS --> | |
513 <!-- OBJECT EVENT FIELDS --> | |
514 <!-- FUNCTION PARAMETERS --> | |
515 </div> | |
516 </div> | |
517 </dl> | |
518 </dd> | |
519 <!-- OBJECT METHODS --> | |
520 <!-- OBJECT EVENT FIELDS --> | |
521 <!-- FUNCTION PARAMETERS --> | |
522 </div> | |
523 </div> | |
524 </dl> | |
525 </div> | |
526 </div> | |
527 <!-- MIN_VERSION --> | |
528 </div> <!-- /description --> | |
529 </div> <!-- /apiItem --> | |
530 </div> <!-- /apiGroup --> | |
531 <!-- EVENTS --> | |
532 <!-- /apiGroup --> | |
533 <!-- TYPES --> | |
534 <!-- /apiGroup --> | |
535 </div> <!-- /apiPage --> | |
536 </div> <!-- /gc-pagecontent --> | |
537 </div> <!-- /g-section --> | |
538 </div> <!-- /codesiteContent --> | |
539 <div id="gc-footer" --=""> | |
540 <div class="text"> | |
541 <p> | |
542 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
543 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
544 Attribution 3.0 License</a>, and code samples are licensed under the | |
545 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
546 </p> | |
547 <p> | |
548 ©2011 Google | |
549 </p> | |
550 <!-- begin analytics --> | |
551 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
552 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
553 <script type="text/javascript"> | |
554 // chrome doc tracking | |
555 try { | |
556 var engdocs = _gat._getTracker("YT-10763712-2"); | |
557 engdocs._trackPageview(); | |
558 } catch(err) {} | |
559 // code.google.com site-wide tracking | |
560 try { | |
561 _uacct="UA-18071-1"; | |
562 _uanchor=1; | |
563 _uff=0; | |
564 urchinTracker(); | |
565 } | |
566 catch(e) {/* urchinTracker not available. */} | |
567 </script> | |
568 <!-- end analytics --> | |
569 </div> | |
570 </div> <!-- /gc-footer --> | |
571 </div> <!-- /gc-container --> | |
572 </body></html> | |
OLD | NEW |