File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
chromium/third_party/devtools-frontend/src/front_end/models/extensions Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1172,9 +1172,17 @@ self.injectedExtensionAPI = function(
1172
1172
this . onRecordingStopped = new ( Constructor ( EventSink ) ) ( PrivateAPI . Events . RecordingStopped + id ) ;
1173
1173
}
1174
1174
1175
+ const protocolGet = Object . getOwnPropertyDescriptor ( URL . prototype , 'protocol' ) ?. get ;
1176
+ function getProtocol ( url : string ) : string {
1177
+ if ( ! protocolGet ) {
1178
+ throw new Error ( 'URL.protocol is not available' ) ;
1179
+ }
1180
+ return protocolGet . call ( new URL ( url ) ) ;
1181
+ }
1182
+
1175
1183
function canAccessResource ( resource : APIImpl . ResourceData ) : boolean {
1176
1184
try {
1177
- return extensionInfo . allowFileAccess || ( new URL ( resource . url ) ) . protocol !== 'file:' ;
1185
+ return extensionInfo . allowFileAccess || getProtocol ( resource . url ) !== 'file:' ;
1178
1186
} catch ( e ) {
1179
1187
return false ;
1180
1188
}
You can’t perform that action at this time.
0 commit comments