2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
7 window.WebInspector = {
11 WebInspector.Events = {
12 InspectorLoaded: "InspectorLoaded"
16 * @param {string} name
19 WebInspector.queryParam = function(name)
21 return WebInspector._queryParamsObject.hasOwnProperty(name) ? WebInspector._queryParamsObject[name] : null;
24 {(function parseQueryParameters()
26 var queryParams = window.location.search;
29 var params = queryParams.substring(1).split("&");
30 for (var i = 0; i < params.length; ++i) {
31 var pair = params[i].split("=");
32 WebInspector._queryParamsObject[pair[0]] = pair[1];
35 // Patch settings from the URL param (for tests).
36 var settingsParam = WebInspector.queryParam("settings");
39 var settings = JSON.parse(window.decodeURI(settingsParam));
40 for (var key in settings)
41 window.localStorage[key] = settings[key];
43 // Ignore malformed settings.