Skip to content

fix(inspector): Fix API compatibility issue with Inspector #838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/debugging/Inspector/Inspector/Inspector/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@ int main(int argc, const char* argv[]) {
[runningApplications[0] activateWithOptions:NSApplicationActivateIgnoringOtherApps];
} else {
NSDictionary* configuration = @{
NSWorkspaceLaunchConfigurationArguments : @[ main_file_path, project_name, socket_path ],
NSWorkspaceLaunchConfigurationEnvironment : @{ @"DYLD_FRAMEWORK_PATH" : [[NSBundle mainBundle] privateFrameworksPath] }
NSWorkspaceLaunchConfigurationArguments : @[ main_file_path, project_name, socket_path ]
};


// Check: Starting with High Sierra some internal APIs
// used by WebKit are not present. We resort to compat libraries
// instead of using our own until we upgrade to the latest WebKit version.
NSProcessInfo *pInfo = [NSProcessInfo processInfo];
NSOperatingSystemVersion version = {.majorVersion = 10, .minorVersion = 13};

if (![pInfo isOperatingSystemAtLeastVersion:version]){
[configuration setValue:@{ @"DYLD_FRAMEWORK_PATH" : [[NSBundle mainBundle] privateFrameworksPath]} forKey:NSWorkspaceLaunchConfigurationEnvironment];
}

[[NSWorkspace sharedWorkspace] launchApplicationAtURL:applicationBundle.bundleURL options:0 configuration:configuration error:nil];
}

Expand Down