question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should useWebKit be default?

See original GitHub issue

Question

Should we default useWebKit to true as the default for all static methods? (e.g. CookieManager.clearAll(true)) Given that react-native-webview from the community has now removed UIWebView entirely (link), it seems it would make sense to default to using WKWebView (aka useWebKit).

This would be a breaking chance, so despite 4.0 just being release it would probably to wait until 5.0 to be released.

Thoughts?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
davidgoveacommented, Aug 14, 2020

I had the similar idea, but after looking into it, the “default” mode (NSHTTPCookieStorage) is used for react-native’s network stack (i.e. fetch(), etc)

That would make changing the default quite a large change for anyone relying on that behavior (as opposed to just webview cookie management). Not sure if that is a common use-case, but I suppose the change would be OK if it is rare.

I actually need to manage the cookies on “both sides” in iOS, so I’ve been using hacks like:

for (const useWebkit of [false, true]) {
  // Call both non-webkit and webkit variants on iOS, but only once on Android
  if (!useWebkit || Platform.OS === 'ios') {
    CookieManager.set(url, cookie, useWebkit);
  }
}

To me, it would be nice to auto-sync the cookies between the two stores on iOS – but again, not sure if my usecase is common.

1reaction
safaiyehcommented, Aug 14, 2020

Sweet ill take this up as a documentation task

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should useWebKit be default? · Issue #69 · react-native- ...
Question Should we default useWebKit to true as the default for all static methods? (e.g. CookieManager.clearAll(true)) Given that ...
Read more >
WebView · React Native
On iOS, the useWebKit prop can be used to opt into a WKWebView-backed ... never (default) - WebView will not allow a secure...
Read more >
How can i know when to use -webkit-, -moz, -ms-, -o-, etc?
If I weren't using preprocessors, I would still have considered writing vendor prefix css along with the default property name.
Read more >
WKWebView | Apple Developer Documentation
Use the WKWebViewConfiguration object to change the default data detector behavior. You can also use setMagnification(_:centeredAt:) to programmatically set ...
Read more >
CSS Appearance | Can I use... Support tables for HTML5 ...
The appearance property defines how elements (particularly form controls) appear by default. By setting the value to none the default appearance can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found