Revision: 29579
http://sourceforge.net/p/bibdesk/svn/29579
Author: hofman
Date: 2025-09-14 16:03:59 +0000 (Sun, 14 Sep 2025)
Log Message:
-----------
set app name for user agent for webviews
Modified Paths:
--------------
trunk/bibdesk/BDSKTextImportController.m
trunk/bibdesk/BDSKWebView.m
Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m 2025-09-14 14:35:53 UTC (rev
29578)
+++ trunk/bibdesk/BDSKTextImportController.m 2025-09-14 16:03:59 UTC (rev
29579)
@@ -627,16 +627,17 @@
#pragma mark Setup
- (void)setupWebView {
+ WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
+ [config setApplicationNameForUserAgent:[NSString
stringWithFormat:@"%@/%@", [[NSBundle mainBundle]
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[NSBundle
mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]];
+
[self willChangeValueForKey:@"webView"];
-
- webView = [[BDSKWKWebView alloc] initWithFrame:NSRectToCGRect([webViewBox
contentRect]) configuration:[[WKWebViewConfiguration alloc] init]];
+ webView = [[BDSKWKWebView alloc] initWithFrame:NSRectToCGRect([webViewBox
contentRect]) configuration:config];
+ [self didChangeValueForKey:@"webView"];
[webView setNavigationDelegate:self];
[webView setUIDelegate:self];
[webView addObserver:self forKeyPath:@"loading" options:0
context:&BDSKTextImportWebViewObservationContext];
- [self didChangeValueForKey:@"webView"];
-
[webViewBox setContentView:webView];
}
Modified: trunk/bibdesk/BDSKWebView.m
===================================================================
--- trunk/bibdesk/BDSKWebView.m 2025-09-14 14:35:53 UTC (rev 29578)
+++ trunk/bibdesk/BDSKWebView.m 2025-09-14 16:03:59 UTC (rev 29579)
@@ -96,6 +96,7 @@
[self setUIDelegate:webDelegate];
[self setEditingDelegate:webDelegate];
[self setDownloadDelegate:[[BDSKDownloadManager sharedManager]
webDownloadDelegate]];
+ [self setApplicationNameForUserAgent:[NSString
stringWithFormat:@"%@/%@", [[NSBundle mainBundle]
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[NSBundle
mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]];
}
return self;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit