Skip to content

Commit

Permalink
Remove RN about:srcdoc warning (#215)
Browse files Browse the repository at this point in the history
* Remove RN about:srcdoc warning

Plaid for some reason, will attempt to set window.location = about:srcdoc
The way I used to filter it seems to produce a warning
So I just let existing requestHandler, handleQuilttEvent and handleOAuthUrl to handle.

Also remove an unnecessary HB reporting

* changeset

* Remove debug log
  • Loading branch information
tom-quiltt authored Mar 20, 2024
1 parent a215fb8 commit c36abb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changeset/pink-horses-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@quiltt/react-native": patch
"@quiltt/core": patch
"@quiltt/react": patch
"@quiltt/examples-nextjs": patch
---

Remove React Native SDK about:srcdoc warning
6 changes: 3 additions & 3 deletions packages/react-native/src/components/QuilttConnector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ const QuilttConnector = ({
(url: URL) => {
if (isQuilttEvent(url)) return false
if (url.protocol !== 'https:') {
const err = new Error(`Invalid url leaked ${url.href}`)
errorReporter.send(err)
return false
}
return allowedListUrl.some((href) => url.href.includes(href))
Expand Down Expand Up @@ -252,7 +250,9 @@ const QuilttConnector = ({
<AndroidSafeAreaView>
<WebView
ref={webViewRef}
originWhitelist={['https://*', 'quilttconnector://*']} // Guard against other non SDK needed url
// Plaid keep sending window.location = 'about:srcdoc' and causes some noise in RN
// All whitelists are now handled in requestHandler, handleQuilttEvent and handleOAuthUrl
originWhitelist={['*']}
source={{ uri: connectorUrl }}
onShouldStartLoadWithRequest={requestHandler}
javaScriptEnabled
Expand Down

0 comments on commit c36abb4

Please sign in to comment.