diff --git a/p5.js-screen-saver/p5_js_screen_saverView.m b/p5.js-screen-saver/p5_js_screen_saverView.m index ed0226c..7692f4b 100644 --- a/p5.js-screen-saver/p5_js_screen_saverView.m +++ b/p5.js-screen-saver/p5_js_screen_saverView.m @@ -28,10 +28,20 @@ - (instancetype)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview webView.navigationDelegate = self; NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0]; [webView loadRequest:request]; + + // Hide webview while loading + [webView setHidden:true]; + [self addSubview:webView]; return self; } +// Show webview when finished loading +- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation; +{ + [webView setHidden:false]; +} + - (void)startAnimation { [super startAnimation];