Fix "realm constructor not defined" in JS remote debugging mode

This commit is contained in:
Michel Albers 2017-10-25 18:16:23 +02:00
parent 2df308ae64
commit f98eb7a4ec
1 changed files with 7 additions and 0 deletions

View File

@ -51,6 +51,13 @@ function getContext() {
return 'chromedebugger';
}
// Check if its in remote js debugging mode
// https://stackoverflow.com/a/42839384/3090989
if (typeof atob !== 'undefined') {
return 'chromedebugger';
}
// Otherwise, we must be in a "normal" react native situation.
// In that case, the Realm type should have been injected by the native code.
// If it hasn't, the user likely forgot to run link.