<!DOCTYPE html> <!-- * Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this * source code is governed by a BSD-style license that can be found in the * LICENSE file. --> <html> <head> <title> Simple Background App </title> <style> .hidden { display: none; } #unsupported { color: #d00; } </style> </head> <body> <h1> Simple Background App </h1> <p id="supported" class="hidden"> <button onclick="openBackgroundWindow()">Open background window</button> <button onclick="closeBackgroundWindow()">Close background window</button> </p> <p id="unsupported" class="hidden"> You are not using Chrome or have not installed the application for this page. </p> <script> // Check for support if (window.chrome && window.chrome.app && window.chrome.app.isInstalled) { document.getElementById('supported').className = ''; } else { document.getElementById('unsupported').className = ''; } var bgWinUrl = "background.html#yay"; var bgWinName = "bgNotifier"; function openBackgroundWindow() { window.open(bgWinUrl, bgWinName, "background"); } function closeBackgroundWindow() { var w = window.open(bgWinUrl, bgWinName, "background"); w.close(); } </script> <p> This app displays a notification whenever its background window is created. Background windows and this app are described in the <a href="http://code.google.com/chrome/apps/docs/developers_guide.html">apps documentation</a>. </p> <p> The generic source code is available for <a href="http://code.google.com/chrome/extensions/trunk/examples/apps/background-simple.zip">download</a>. The <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/apps/background-simple/README?content-type=text/plain">README</a> tells you how to modify the code. </p> <p> If you just want to run a version of this app that's already on the web, here's how: </p> <ol> <li> <a href="http://background-simple.appspot.com/app.crx">Install the app</a> from background-simple.appspot.com. </li> <li> Launch Simple Background App from the New Tab page. </li> </ol> </body> </html>