-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(WKWebview): Add shared process pool so cookies and localStorage …
…are shared across webviews in iOS (#138) * fix(WKWebview): [iOS] Add shared process pool so cookies and localStorage are shared across webviews (#68) * Add optional shared process pool BREAKING CHANGE: useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
- Loading branch information
1 parent
335792c
commit afadc62
Showing
8 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <WebKit/WebKit.h> | ||
|
||
@interface RNCWKProcessPoolManager : NSObject | ||
|
||
+ (instancetype) sharedManager; | ||
- (WKProcessPool *)sharedProcessPool; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "RNCWKProcessPoolManager.h" | ||
|
||
@interface RNCWKProcessPoolManager() { | ||
WKProcessPool *_sharedProcessPool; | ||
} | ||
@end | ||
|
||
@implementation RNCWKProcessPoolManager | ||
|
||
+ (id) sharedManager { | ||
static RNCWKProcessPoolManager *_sharedManager = nil; | ||
@synchronized(self) { | ||
if(_sharedManager == nil) { | ||
_sharedManager = [[super alloc] init]; | ||
} | ||
return _sharedManager; | ||
} | ||
} | ||
|
||
- (WKProcessPool *)sharedProcessPool { | ||
if (!_sharedProcessPool) { | ||
_sharedProcessPool = [[WKProcessPool alloc] init]; | ||
} | ||
return _sharedProcessPool; | ||
} | ||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters