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

Side by Side Diff: chrome/common/extensions/docs/examples/apps/background-simple/index.js

Issue 9289057: Changing manifest to v2 extension samples (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding zip files after rebasing with master Created 8 years, 10 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
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 // Check for support
6 if (window.chrome && window.chrome.app && window.chrome.app.isInstalled) {
7 document.getElementById('supported').className = '';
8 } else {
9 document.getElementById('unsupported').className = '';
10 }
11 var bgWinUrl = "background.html#yay";
12 var bgWinName = "bgNotifier";
13
14 function openBackgroundWindow() {
15 window.open(bgWinUrl, bgWinName, "background");
16 }
17
18 function closeBackgroundWindow() {
19 var w = window.open(bgWinUrl, bgWinName, "background");
20 w.close();
21 }
22
23 document.addEventListener('DOMContentLoaded', function() {
24 document.querySelector('#openBackgroundWindow').addEventListener(
25 'click', openBackgroundWindow);
26 document.querySelector('#closeBackgroundWindow').addEventListener(
27 'click', closeBackgroundWindow);
28 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698