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.
@@ -117,6 +117,7 @@
117
117
  height: 26px;
118
118
  line-height: 16px;
119
119
  white-space: nowrap;
120
+ cursor: default;
120
121
  display: flex;
121
122
  align-items: center;
122
123
  color: var(--color-text-secondary);
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
55
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
56
56
  },
57
- "version": "1.0.971727"
57
+ "version": "1.0.972361"
58
58
  }
@@ -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
  });