| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 */ | 8 */ |
| 9 WebInspector.NetworkConfigView = function() | 9 WebInspector.NetworkConfigView = function() |
| 10 { | 10 { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 */ | 91 */ |
| 92 WebInspector.NetworkConfigView.createUserAgentSelectAndInput = function() | 92 WebInspector.NetworkConfigView.createUserAgentSelectAndInput = function() |
| 93 { | 93 { |
| 94 var userAgentSetting = WebInspector.settings.createSetting("customUserAgent"
, ""); | 94 var userAgentSetting = WebInspector.settings.createSetting("customUserAgent"
, ""); |
| 95 var userAgentSelectElement = createElement("select"); | 95 var userAgentSelectElement = createElement("select"); |
| 96 | 96 |
| 97 const customOverride = {title: WebInspector.UIString("Custom..."), value: "c
ustom"}; | 97 const customOverride = {title: WebInspector.UIString("Custom..."), value: "c
ustom"}; |
| 98 userAgentSelectElement.appendChild(new Option(customOverride.title, customOv
erride.value)); | 98 userAgentSelectElement.appendChild(new Option(customOverride.title, customOv
erride.value)); |
| 99 | 99 |
| 100 var groups = WebInspector.NetworkConfigView._userAgentGroups; | 100 var groups = WebInspector.NetworkConfigView._userAgentGroups; |
| 101 for (var userAgentDescriptor of WebInspector.NetworkConfigView._userAgentGro
ups) { | 101 for (var userAgentDescriptor of groups) { |
| 102 var groupElement = userAgentSelectElement.createChild("optgroup"); | 102 var groupElement = userAgentSelectElement.createChild("optgroup"); |
| 103 groupElement.label = userAgentDescriptor.title; | 103 groupElement.label = userAgentDescriptor.title; |
| 104 for (var userAgentVersion of userAgentDescriptor.values) | 104 for (var userAgentVersion of userAgentDescriptor.values) { |
| 105 groupElement.appendChild(new Option(userAgentVersion.title, userAgen
tVersion.value)); | 105 var userAgentValue = userAgentVersion.value; |
| 106 if (userAgentDescriptor.title === "Chrome") |
| 107 userAgentValue = WebInspector.BrowserVersionInfo.patchStringWith
CurrentVersion(userAgentValue); |
| 108 groupElement.appendChild(new Option(userAgentVersion.title, userAgen
tValue)); |
| 109 } |
| 106 } | 110 } |
| 107 | 111 |
| 108 userAgentSelectElement.selectedIndex = 0; | 112 userAgentSelectElement.selectedIndex = 0; |
| 109 | 113 |
| 110 var otherUserAgentElement = createElement("input"); | 114 var otherUserAgentElement = createElement("input"); |
| 111 otherUserAgentElement.type = "text"; | 115 otherUserAgentElement.type = "text"; |
| 112 otherUserAgentElement.value = userAgentSetting.get(); | 116 otherUserAgentElement.value = userAgentSetting.get(); |
| 113 otherUserAgentElement.title = userAgentSetting.get(); | 117 otherUserAgentElement.title = userAgentSetting.get(); |
| 114 otherUserAgentElement.placeholder = WebInspector.UIString("Enter a custom us
er agent"); | 118 otherUserAgentElement.placeholder = WebInspector.UIString("Enter a custom us
er agent"); |
| 115 otherUserAgentElement.required = true; | 119 otherUserAgentElement.required = true; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 if (userAgentSetting.get() !== otherUserAgentElement.value) { | 156 if (userAgentSetting.get() !== otherUserAgentElement.value) { |
| 153 userAgentSetting.set(otherUserAgentElement.value); | 157 userAgentSetting.set(otherUserAgentElement.value); |
| 154 otherUserAgentElement.title = otherUserAgentElement.value; | 158 otherUserAgentElement.title = otherUserAgentElement.value; |
| 155 settingChanged(); | 159 settingChanged(); |
| 156 } | 160 } |
| 157 } | 161 } |
| 158 | 162 |
| 159 return { select: userAgentSelectElement, input: otherUserAgentElement }; | 163 return { select: userAgentSelectElement, input: otherUserAgentElement }; |
| 160 } | 164 } |
| 161 | 165 |
| 162 | |
| 163 /** @type {!Array.<{title: string, values: !Array.<{title: string, value: string
}>}>} */ | 166 /** @type {!Array.<{title: string, values: !Array.<{title: string, value: string
}>}>} */ |
| 164 WebInspector.NetworkConfigView._userAgentGroups = [ | 167 WebInspector.NetworkConfigView._userAgentGroups = [ |
| 165 { | 168 { |
| 166 title: "Android", | 169 title: "Android", |
| 167 values: [ | 170 values: [ |
| 168 {title: "Android (4.0.2) Browser \u2014 Galaxy Nexus", value: "Mozil
la/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/5
34.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"}, | 171 {title: "Android (4.0.2) Browser \u2014 Galaxy Nexus", value: "Mozil
la/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/5
34.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"}, |
| 169 {title: "Android (2.3) Browser \u2014 Nexus S", value: "Mozilla/5.0
(Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML,
like Gecko) Version/4.0 Mobile Safari/533.1"} | 172 {title: "Android (2.3) Browser \u2014 Nexus S", value: "Mozilla/5.0
(Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML,
like Gecko) Version/4.0 Mobile Safari/533.1"} |
| 170 ] | 173 ] |
| 171 }, | 174 }, |
| 172 { | 175 { |
| 173 title: "BlackBerry", | 176 title: "BlackBerry", |
| 174 values: [ | 177 values: [ |
| 175 {title: "BlackBerry \u2014 BB10", value: "Mozilla/5.0 (BB10; Touch)
AppleWebKit/537.1+ (KHTML, like Gecko) Version/10.0.0.1337 Mobile Safari/537.1+"
}, | 178 {title: "BlackBerry \u2014 BB10", value: "Mozilla/5.0 (BB10; Touch)
AppleWebKit/537.1+ (KHTML, like Gecko) Version/10.0.0.1337 Mobile Safari/537.1+"
}, |
| 176 {title: "BlackBerry \u2014 PlayBook 2.1", value: "Mozilla/5.0 (PlayB
ook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Versi
on/7.2.1.0 Safari/536.2+"}, | 179 {title: "BlackBerry \u2014 PlayBook 2.1", value: "Mozilla/5.0 (PlayB
ook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Versi
on/7.2.1.0 Safari/536.2+"}, |
| 177 {title: "BlackBerry \u2014 9900", value: "Mozilla/5.0 (BlackBerry; U
; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.
187 Mobile Safari/534.11+"} | 180 {title: "BlackBerry \u2014 9900", value: "Mozilla/5.0 (BlackBerry; U
; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.
187 Mobile Safari/534.11+"} |
| 178 ] | 181 ] |
| 179 }, | 182 }, |
| 180 { | 183 { |
| 181 title: "Chrome", | 184 title: "Chrome", |
| 182 values: [ | 185 values: [ |
| 183 {title: "Chrome 52 \u2014 Android Mobile", value: "Mozilla/5.0 (Linu
x; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chr
ome/52.0.2725.0 Mobile Safari/537.36"}, | 186 {title: "Chrome \u2014 Android Mobile", value: "Mozilla/5.0 (Linux;
Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome
/%s Mobile Safari/537.36"}, |
| 184 {title: "Chrome 52 \u2014 Android Tablet", value: "Mozilla/5.0 (Linu
x; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chr
ome/52.0.2725.0 Safari/537.36"}, | 187 {title: "Chrome \u2014 Android Tablet", value: "Mozilla/5.0 (Linux;
Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome
/%s Safari/537.36"}, |
| 185 {title: "Chrome 52 \u2014 iPhone", value: "Mozilla/5.0 (iPhone; CPU
iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/52.0.27
25.0 Mobile/13B143 Safari/601.1.46"}, | 188 {title: "Chrome \u2014 iPhone", value: "Mozilla/5.0 (iPhone; CPU iPh
one OS 9_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/%s Mobile/
13B143 Safari/601.1.46"}, |
| 186 {title: "Chrome 52 \u2014 iPad", value: "Mozilla/5.0 (iPad; CPU OS 9
_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/52.0.2725.0 Mobile
/13B143 Safari/601.1.46"}, | 189 {title: "Chrome \u2014 iPad", value: "Mozilla/5.0 (iPad; CPU OS 9_1
like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/%s Mobile/13B143 Safa
ri/601.1.46"}, |
| 187 {title: "Chrome 52 \u2014 Mac", value: "Mozilla/5.0 (Macintosh; Inte
l Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2725.0 Sa
fari/537.36"}, | 190 {title: "Chrome \u2014 Mac", value: "Mozilla/5.0 (Macintosh; Intel M
ac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36"
}, |
| 188 {title: "Chrome 52 \u2014 Windows", value: "Mozilla/5.0 (Windows NT
10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2725.0 Safari/53
7.36"} | 191 {title: "Chrome \u2014 Windows", value: "Mozilla/5.0 (Windows NT 10.
0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36"} |
| 189 ] | 192 ] |
| 190 }, | 193 }, |
| 191 { | 194 { |
| 192 title: "Edge", | 195 title: "Edge", |
| 193 values: [ | 196 values: [ |
| 194 {title: "Edge \u2014 Windows", value: "Mozilla/5.0 (Windows NT 10.0;
Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/
537.36 Edge/12.10240"}, | 197 {title: "Edge \u2014 Windows", value: "Mozilla/5.0 (Windows NT 10.0;
Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/
537.36 Edge/12.10240"}, |
| 195 {title: "Edge \u2014 Mobile", value: "Mozilla/5.0 (Windows Phone 10.
0; Android 4.2.1; Microsoft; Lumia 640 XL LTE) AppleWebKit/537.36 (KHTML, like G
ecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/12.10166"}, | 198 {title: "Edge \u2014 Mobile", value: "Mozilla/5.0 (Windows Phone 10.
0; Android 4.2.1; Microsoft; Lumia 640 XL LTE) AppleWebKit/537.36 (KHTML, like G
ecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/12.10166"}, |
| 196 {title: "Edge \u2014 XBox", value: "Mozilla/5.0 (Windows NT 10.0; Wi
n64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.231
1.135 Safari/537.36 Edge/13.10586"} | 199 {title: "Edge \u2014 XBox", value: "Mozilla/5.0 (Windows NT 10.0; Wi
n64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.231
1.135 Safari/537.36 Edge/13.10586"} |
| 197 ] | 200 ] |
| 198 }, | 201 }, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 }, | 240 }, |
| 238 { | 241 { |
| 239 title: "Safari", | 242 title: "Safari", |
| 240 values: [ | 243 values: [ |
| 241 {title: "Safari \u2014 iPad iOS 9", value: "Mozilla/5.0 (iPad; CPU O
S 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile
/13B137 Safari/601.1"}, | 244 {title: "Safari \u2014 iPad iOS 9", value: "Mozilla/5.0 (iPad; CPU O
S 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile
/13B137 Safari/601.1"}, |
| 242 {title: "Safari \u2014 iPhone iOS 9", value: "Mozilla/5.0 (iPhone; C
PU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version
/9.0 Mobile/13B137 Safari/601.1"}, | 245 {title: "Safari \u2014 iPhone iOS 9", value: "Mozilla/5.0 (iPhone; C
PU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version
/9.0 Mobile/13B137 Safari/601.1"}, |
| 243 {title: "Safari \u2014 Mac", value: "Mozilla/5.0 (Macintosh; Intel M
ac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7
046A194A"} | 246 {title: "Safari \u2014 Mac", value: "Mozilla/5.0 (Macintosh; Intel M
ac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7
046A194A"} |
| 244 ] | 247 ] |
| 245 } | 248 } |
| 246 ] | 249 ] |
| OLD | NEW |