FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[[ Bug 22816 ]] Fix permissions when loading a local html file by livecodepanos · Pull Request #7407 · livecode/livecode · GitHub

This repository was archived by the owner on Aug 31, 2021. It is now read-only.
/ livecode Public archive
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .mm  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions docs/notes/bugfix-22816.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fix permissions when loading a local html file on iOS 12
11 changes: 10 additions & 1 deletion libbrowser/src/libbrowser_wkwebview.mm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,16 @@ - (void) loadRequest:(MCWKWebViewLoadRequest *)request inWebView:(WKWebView *)we
MCBrowserRunBlockOnMainFiber(^{
if (request.htmlText == nil)
{
[webView loadRequest:[NSURLRequest requestWithURL:request.url]];
if (![request.url isFileURL])
[webView loadRequest:[NSURLRequest requestWithURL:request.url]];
else
{
NSURL *t_docs_dir_url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
if ([request.url.absoluteString hasPrefix:t_docs_dir_url.absoluteString])
[webView loadFileURL:request.url allowingReadAccessToURL:t_docs_dir_url];
else
[webView loadFileURL:request.url allowingReadAccessToURL:request.url.URLByDeletingLastPathComponent];
}
}
else
{
Expand Down

Back | FazBrowse Home | New Git URL