File tree Expand file tree Collapse file tree 3 files changed +30
-10
lines changed
src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/ImmutableWebView.bundle/Contents Expand file tree Collapse file tree 3 files changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -322,12 +322,32 @@ - (void)loadURL:(const char *)url
322322{
323323 if (webView == nil )
324324 return ;
325-
325+
326326 WKWebView *_webView = (WKWebView *)webView;
327327 NSString *urlStr = [NSString stringWithUTF8String: url];
328328 NSURL *nsurl = [NSURL URLWithString: urlStr];
329- NSURLRequest *request = [NSURLRequest requestWithURL: nsurl];
330- [_webView load: request];
329+
330+ // Check if it's a file URL
331+ if ([nsurl.scheme isEqualToString: @" file" ]) {
332+ // Load file content as HTML string with a proper base URL
333+ NSError *error = nil ;
334+ NSString *htmlString = [NSString stringWithContentsOfURL: nsurl
335+ encoding: NSUTF8StringEncoding
336+ error: &error];
337+
338+ if (error) {
339+ NSLog (@" Error loading file: %@ " , error.localizedDescription);
340+ return ;
341+ }
342+
343+ // Use http://localhost as base URL to avoid null origin
344+ NSURL *baseURL = [NSURL URLWithString: @" http://localhost/" ];
345+ [_webView loadHTMLString: htmlString baseURL: baseURL];
346+ } else {
347+ // Load remote URLs normally
348+ NSURLRequest *request = [NSURLRequest requestWithURL: nsurl];
349+ [_webView loadRequest: request];
350+ }
331351}
332352
333353- (void )launchAuthURL : (const char *)url redirectUri : (const char *)redirectUri
Original file line number Diff line number Diff line change 33<plist version =" 1.0" >
44<dict >
55 <key >BuildMachineOSBuild </key >
6- <string >23G93 </string >
6+ <string >25B78 </string >
77 <key >CFBundleDevelopmentRegion </key >
88 <string >English </string >
99 <key >CFBundleExecutable </key >
2929 <key >DTCompiler </key >
3030 <string >com.apple.compilers.llvm.clang.1_0 </string >
3131 <key >DTPlatformBuild </key >
32- <string >24A336 </string >
32+ <string >25B74 </string >
3333 <key >DTPlatformName </key >
3434 <string >macosx </string >
3535 <key >DTPlatformVersion </key >
36- <string >15.0 </string >
36+ <string >26.1 </string >
3737 <key >DTSDKBuild </key >
38- <string >24A336 </string >
38+ <string >25B74 </string >
3939 <key >DTSDKName </key >
40- <string >macosx15.0 </string >
40+ <string >macosx26.1 </string >
4141 <key >DTXcode </key >
42- <string >1600 </string >
42+ <string >2611 </string >
4343 <key >DTXcodeBuild </key >
44- <string >16A242d </string >
44+ <string >17B100 </string >
4545 <key >LSMinimumSystemVersion </key >
4646 <string >12.4 </string >
4747</dict >
You can’t perform that action at this time.
0 commit comments