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// Update the declarative rules on install or upgrade.
6chrome.runtime.onInstalled.addListener(function() {
7  chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
8    chrome.declarativeContent.onPageChanged.addRules([{
9      conditions: [
10        // When a page contains a <video> tag...
11        new chrome.declarativeContent.PageStateMatcher({
12          css: ["video"]
13        })
14      ],
15      // ... show the page action.
16      actions: [new chrome.declarativeContent.ShowPageAction() ]
17    }]);
18  });
19});
20