chrome-devtools-frontend 1.0.971727 → 1.0.972361
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +1 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +2 -16
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -8
- package/front_end/panels/changes/ChangesView.ts +4 -4
- package/front_end/panels/elements/StylesSidebarPane.ts +27 -15
- package/front_end/panels/sources/NavigatorView.ts +3 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1047 -1158
- package/front_end/third_party/lighthouse/locales/en-US.json +7 -1
- package/front_end/third_party/lighthouse/locales/en-XL.json +7 -1
- package/front_end/third_party/lighthouse/report/bundle.d.ts +0 -3
- package/front_end/third_party/lighthouse/report/bundle.js +38 -24
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/ui/legacy/tabbedPane.css +1 -0
- package/package.json +1 -1
- package/scripts/hosted_mode/server.js +13 -0
package/package.json
CHANGED
@@ -177,6 +177,19 @@ async function requestHandler(request, response) {
|
|
177
177
|
// This is fine to do given that test invocations run against fresh Chrome profiles.
|
178
178
|
headers.set('Cache-Control', 'max-age=3600');
|
179
179
|
}
|
180
|
+
if (!headers.get('Access-Control-Allow-Origin')) {
|
181
|
+
// The DevTools frontend in hosted-mode uses regular fetch to get source maps etc.
|
182
|
+
// Disable CORS only for the DevTools frontend, not for resource/target pages.
|
183
|
+
// Since Chrome will cache resources, we have to indicate that CORS can still vary
|
184
|
+
// based on the origin that made the request. E.g. the target page loads a script first
|
185
|
+
// but then DevTools also wants to load it. In the former, we disallow cross-origin requests by default,
|
186
|
+
// while for the latter we allow it.
|
187
|
+
const requestedByDevTools = request.headers.origin?.includes('devtools-frontend.test');
|
188
|
+
if (requestedByDevTools) {
|
189
|
+
headers.set('Access-Control-Allow-Origin', request.headers.origin);
|
190
|
+
}
|
191
|
+
headers.set('Vary', 'Origin');
|
192
|
+
}
|
180
193
|
headers.forEach((value, header) => {
|
181
194
|
response.setHeader(header, value);
|
182
195
|
});
|