mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[darwin] Add a macOS version guard for opening the web inspector (#2397)
Log if the inspector could not be opened due to missing or incorrect private API.
This commit is contained in:
@@ -21,14 +21,28 @@ package darwin
|
||||
@end
|
||||
|
||||
void showInspector(void *inctx) {
|
||||
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
||||
if (@available(macOS 12.0, *)) {
|
||||
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
||||
|
||||
[ctx.webview._inspector show];
|
||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC);
|
||||
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
|
||||
// Detach must be deferred a little bit and is ignored directly after a show.
|
||||
[ctx.webview._inspector detach];
|
||||
});
|
||||
@try {
|
||||
[ctx.webview._inspector show];
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"Opening the inspector failed: %@", exception.reason);
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC);
|
||||
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
|
||||
// Detach must be deferred a little bit and is ignored directly after a show.
|
||||
@try {
|
||||
[ctx.webview._inspector detach];
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"Detaching the inspector failed: %@", exception.reason);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
NSLog(@"Opening the inspector needs at least MacOS 12");
|
||||
}
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
|
||||
- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
|
||||
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
|
||||
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
|
||||
|
||||
## v2.3.0 - 2022-12-29
|
||||
|
||||
|
||||
Reference in New Issue
Block a user