Script origins control inline policy, all scripts allowed for tab
This commit is contained in:
@@ -37,6 +37,12 @@
|
||||
|
||||
// Set up process pool
|
||||
WKProcessPool *processPool = [[WKProcessPool alloc] _initWithConfiguration:poolConfiguration];
|
||||
|
||||
// Initialize allowed origins now
|
||||
NSArray<NSString *> *allowedOrigins = [[_policyDataSource allowedOriginsForScriptResources] allObjects];
|
||||
[processPool _setObject:allowedOrigins forBundleParameter:SBRGetAllowedOriginsKey()];
|
||||
[processPool _setObject:@(_allowAllScripts) forBundleParameter:SBRGetAllScriptsAllowedKey()];
|
||||
|
||||
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
|
||||
configuration.processPool = processPool;
|
||||
|
||||
@@ -79,4 +85,9 @@
|
||||
[_webProcessProxy syncAllowedResourceOrigins:allowedOrigins];
|
||||
}
|
||||
|
||||
- (void)setAllowAllScripts:(BOOL)allowAllScripts
|
||||
{
|
||||
[_webProcessProxy setAllScriptsAllowed:allowAllScripts];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user