-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging JSContext in safari is not enabled for iOS >= 16.4 #39488
Comments
I'll add a comment that this may also be the appropriate place to name the JSContext with a descriptive label (e.g. "React Native"). JSGlobalContextSetName`(jsContextRef, JSStringCreateWithUTF8CString("React Native")); |
@Saadnajmi didn't you add something for this? |
Ah, found it. 8b1bf05 |
One comment here though. The max target check would prevent an iOS device from being used for debugging, no? |
I also have an open change for naming, that hasn’t merged yet: #38942 |
TARGET_OS_MAC includes iOS, surprisingly. Is that what you were concerned about? |
Wait sorry I think I had your comment confused. If you're referring to the __builtin_available check, I believe that before iOS 16.4, when there was no inspectable property, JScontexts' were always debuggable? |
Oh, you had it right, I was referring to So I have no issues with the referenced implementations -- they appear to cover everything I was wanting to acheive! |
@jefflewis For the latter change, you need to access your JSExecutor to name your context. I didn't find a more convenient way like using your apps bundle name as the default.. let me know if you have suggestions there :D |
Heh.. speaking of that earlier change.. turns out I didn't properly support macOS... sooo _JSC_HAS_INSPECTABLE round 2! |
Description
As of iOS 16.4 Apple requires the
isInspectable
property of the JSContext to be set totrue
in order for the JSContext to be shown in the Safari inspector window, as documented as a debugging tool here.This patch would apply this property to
DEBUG
builds and is what I have done to successfully get debugging working again.If I open this as a pull request, would it be accepted?
patch:
Reference:
https://webkit.org/blog/13936/enabling-the-inspection-of-web-content-in-apps/
React Native Version
0.72
Output of
npx react-native info
Steps to reproduce
DEBUG Build any RN iOS with a target of iOS >= 16.4 and see that it is not available for inspection per the documentation.
Snack, screenshot, or link to a repository
Any RN app will demonstrate this, so the base snack should show when configured with a DEBUG build.
https://snack.expo.dev/TRFqpEjAi
The text was updated successfully, but these errors were encountered: