forked from GoogleChrome/chrome-extensions-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
23 lines (20 loc) · 845 Bytes
/
background.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2011 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.
/**
* @fileoverview This file initializes the background page by loading a
* ProxyErrorHandler, and resetting proxy settings if required.
*
* @author Mike West <[email protected]>
*/
document.addEventListener("DOMContentLoaded", function () {
var errorHandler = new ProxyErrorHandler();
// If this extension has already set the proxy settings, then reset it
// once as the background page initializes. This is essential, as
// incognito settings are wiped on restart.
var persistedSettings = ProxyFormController.getPersistedSettings();
if (persistedSettings !== null) {
chrome.proxy.settings.set(
{'value': persistedSettings.regular});
}
});