Closed
Description
The data returned to onMessage WebView callback on iOS is double-percent-encoded.
React Native version: 0.59.8
Steps To Reproduce
- Inject a JS into WebView that calls e.g.
window.postMessage('https://test.com')
- The onMessage handler will receive double-encoded value:
<WebView onMessage={onMessage} ... />
function onMessage(event) {
console.log(event.nativeEvent.data); // "https%253A%252F%252Ftest.com"
}
This was introduced in 61ca119#diff-17ddfccc3e39071c0aa51f82677e6d68 :
Correct method to use instead of stringByReplacingPercentEscapesUsingEncoding
is stringByRemovingPercentEncoding
.
cc @pvinis