From 55fc72e8f5ff04b86b9cd3102b209556b372a8ac Mon Sep 17 00:00:00 2001 From: Baraka Date: Thu, 1 Nov 2018 21:21:31 -0500 Subject: [PATCH] macOS Sierra and above Blocked Plugin Fix + Legacy Xcode Building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to @xrubioj for pointing the his solution This fix addresses the Blocked Plugin issue and UI properties are usable than a blanked out UI from @xrubioj original PR https://github.com/radiant-player/radiant-player-mac/pull/670 Legacy Build System is needed so i enabled it in my workspace Only if you set `UseModernBuildSystem=NO` in the Workspace setting ``` Xcode 9.3 adds a new IDEWorkspaceChecks.plist file to a workspace’s shared data, to store the state of necessary workspace checks. Committing this file to source control will prevent unnecessary rerunning of those checks for each user opening the workspace. ``` --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ .../xcshareddata/WorkspaceSettings.xcsettings | 2 ++ radiant-player-mac/WebView/CustomWebView.m | 18 +++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 radiant-player-mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/radiant-player-mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/radiant-player-mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/radiant-player-mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/radiant-player-mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/radiant-player-mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index 08de0be8..a3f43a8b 100644 --- a/radiant-player-mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/radiant-player-mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -2,6 +2,8 @@ + BuildSystemType + Original IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded diff --git a/radiant-player-mac/WebView/CustomWebView.m b/radiant-player-mac/WebView/CustomWebView.m index 5deaf472..b61ed333 100644 --- a/radiant-player-mac/WebView/CustomWebView.m +++ b/radiant-player-mac/WebView/CustomWebView.m @@ -30,6 +30,22 @@ - (void)awakeFromNib [self setAcceptsTouchEvents:YES]; [self addSubview:swipeView]; + // Check if we are macOS Sierra or higher + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { + + // Since we are doing a customer user-agent, lets show the app version of Radiant + NSString * RadiantVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]; + + // Push and set our custom strings + NSString* RadiantBarakaAgent = [NSString stringWithFormat: @"Safari Radiant Player/%@", RadiantVersion]; + + //Use our default user-agent and push our custom string + [self setApplicationNameForUserAgent:RadiantBarakaAgent]; + + //Testing is needed right? + //NSLog(@"navigator.userAgent = %@", RadiantBarakaAgent); + } + [self setResourceLoadDelegate:self]; [self setUIDelegate:self]; [self setFrameLoadDelegate:self]; @@ -321,4 +337,4 @@ - (NSPoint)touchPositionForTouches:(NSSet *)touches return position; } -@end \ No newline at end of file +@end