mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 01:31:54 +08:00
[mac] Fix ExecJS
This commit is contained in:
parent
86cbcdc089
commit
2dc126bf19
@ -39,8 +39,9 @@ void ProcessURLResponse(void *inctx, const char *url, const char *contentType, c
|
|||||||
|
|
||||||
void ExecJS(void* inctx, const char *script) {
|
void ExecJS(void* inctx, const char *script) {
|
||||||
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
||||||
|
NSString *nsscript = [NSString stringWithUTF8String:script];
|
||||||
ON_MAIN_THREAD(
|
ON_MAIN_THREAD(
|
||||||
[ctx ExecJS:script];
|
[ctx ExecJS:nsscript];
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
- (void) loadRequest:(NSString*)url;
|
- (void) loadRequest:(NSString*)url;
|
||||||
- (void) processURLResponse:(NSString *)url :(NSString *)contentType :(NSData*)data;
|
- (void) processURLResponse:(NSString *)url :(NSString *)contentType :(NSData*)data;
|
||||||
- (void) ExecJS:(const char*)script;
|
- (void) ExecJS:(NSString*)script;
|
||||||
- (NSScreen*) getCurrentScreen;
|
- (NSScreen*) getCurrentScreen;
|
||||||
|
|
||||||
- (void) SetAbout :(const char*)title :(const char*)description :(void*)imagedata :(int)datalen;
|
- (void) SetAbout :(const char*)title :(const char*)description :(void*)imagedata :(int)datalen;
|
||||||
|
@ -362,9 +362,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) ExecJS:(const char*)script {
|
- (void) ExecJS:(NSString*)script {
|
||||||
NSString *nsscript = [NSString stringWithUTF8String:script];
|
ON_MAIN_THREAD(
|
||||||
[self.webview evaluateJavaScript:nsscript completionHandler:nil];
|
[self.webview evaluateJavaScript:script completionHandler:nil];
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) processURLResponse:(NSString *)url :(NSString *)contentType :(NSData *)data {
|
- (void) processURLResponse:(NSString *)url :(NSString *)contentType :(NSData *)data {
|
||||||
|
Loading…
Reference in New Issue
Block a user