metro-inspector-proxy
Advanced tools
Comparing version 0.54.0 to 0.54.1
{ | ||
"name": "metro-inspector-proxy", | ||
"version": "0.54.0", | ||
"version": "0.54.1", | ||
"description": "metro-inspector-proxy", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -24,4 +24,7 @@ /** | ||
const EMULATOR_LOCALHOST_ADDRESSES = ["10.0.2.2", "10.0.3.2"]; | ||
const EMULATOR_LOCALHOST_ADDRESSES = ["10.0.2.2", "10.0.3.2"]; // Prefix for script URLs that are alphanumeric IDs. See comment in _processMessageFromDevice method for | ||
// more details. | ||
const FILE_PREFIX = "file://"; | ||
/** | ||
@@ -81,3 +84,4 @@ * Device class represents single device connection to Inspector Proxy. Each device | ||
const debuggerInfo = { | ||
socket | ||
socket, | ||
prependedFilePrefix: false | ||
}; | ||
@@ -220,2 +224,10 @@ | ||
} | ||
} // Chrome doesn't download source maps if URL param is not a valid | ||
// URL. Some frameworks pass alphanumeric script ID instead of URL which causes | ||
// Chrome to not download source maps. In this case we want to prepend script ID | ||
// with 'file://' prefix. | ||
if (payload.params.url.match(/^[0-9a-z]+$/)) { | ||
payload.params.url = FILE_PREFIX + payload.params.url; | ||
debuggerInfo.prependedFilePrefix = true; | ||
} | ||
@@ -240,2 +252,10 @@ } | ||
); | ||
if ( | ||
payload.params.url.startsWith(FILE_PREFIX) && | ||
debuggerInfo.prependedFilePrefix | ||
) { | ||
// Remove fake URL prefix if we modified URL in _processMessageFromDevice. | ||
payload.params.url = payload.params.url.slice(FILE_PREFIX.length); | ||
} | ||
} | ||
@@ -242,0 +262,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38988
553