Authored by gaoqiang xu

支持添加额外的UserAgent

*.xccheckout
YohoExplorerDemo.xcscheme
Breakpoints_v2.xcbkptlist
... ...
... ... @@ -109,6 +109,15 @@
*/
- (void)explorerDidDetectParameters:(NSDictionary * _Nonnull)params;
/**
@brief 补充userAgent
@return 需要添加的UserAgent
@since 1.1.0
*/
- (NSString * _Nullable)extraUserAgent;
#pragma mark Native
/**
@brief H5端触发Native事件
... ...
... ... @@ -180,6 +180,18 @@ static float kprogressViewRadius = 2.0f;
return _pointerValue;
}
- (NSString*)userAgent
{
_userAgent = [super userAgent];
if ([self.delegate respondsToSelector:@selector(extraUserAgent)]) {
NSString *ua = [self.delegate extraUserAgent];
if (ua.length) {
return [NSString stringWithFormat:@"%@ %@", _userAgent, ua];
}
}
return _userAgent;
}
#pragma mark - Public
- (instancetype)initWithUrl:(NSString *)url
{
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "../YHExplorer/WebProgressView/YHWebViewProgressView.m"
timestampString = "460284588.269866"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "91"
endingLineNumber = "91"
landmarkName = "-setProgress:animated:"
landmarkType = "5">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "p progress">
</ActionContent>
</BreakpointActionProxy>
</Actions>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>