mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 23:02:19 +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) {
|
||||
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
||||
NSString *nsscript = [NSString stringWithUTF8String:script];
|
||||
ON_MAIN_THREAD(
|
||||
[ctx ExecJS:script];
|
||||
[ctx ExecJS:nsscript];
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
|
||||
- (void) loadRequest:(NSString*)url;
|
||||
- (void) processURLResponse:(NSString *)url :(NSString *)contentType :(NSData*)data;
|
||||
- (void) ExecJS:(const char*)script;
|
||||
- (void) ExecJS:(NSString*)script;
|
||||
- (NSScreen*) getCurrentScreen;
|
||||
|
||||
- (void) SetAbout :(const char*)title :(const char*)description :(void*)imagedata :(int)datalen;
|
||||
|
@ -362,9 +362,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void) ExecJS:(const char*)script {
|
||||
NSString *nsscript = [NSString stringWithUTF8String:script];
|
||||
[self.webview evaluateJavaScript:nsscript completionHandler:nil];
|
||||
- (void) ExecJS:(NSString*)script {
|
||||
ON_MAIN_THREAD(
|
||||
[self.webview evaluateJavaScript:script completionHandler:nil];
|
||||
)
|
||||
}
|
||||
|
||||
- (void) processURLResponse:(NSString *)url :(NSString *)contentType :(NSData *)data {
|
||||
|
Loading…
Reference in New Issue
Block a user