1// Copyright (c) 2011 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/**
6 * @fileoverview This file initializes the background page by loading a
7 * ProxyErrorHandler, and resetting proxy settings if required.
8 *
9 * @author Mike West <mkwst@google.com>
10 */
11
12document.addEventListener("DOMContentLoaded", function () {
13  var errorHandler = new ProxyErrorHandler();
14
15  // If this extension has already set the proxy settings, then reset it
16  // once as the background page initializes.  This is essential, as
17  // incognito settings are wiped on restart.
18  var persistedSettings = ProxyFormController.getPersistedSettings();
19  if (persistedSettings !== null) {
20    chrome.proxy.settings.set(
21        {'value': persistedSettings.regular});
22  }
23});
24