use resourceURL for locating bundled web reader web resources

This commit is contained in:
Satindar Dhillon
2022-06-29 15:58:16 -07:00
parent 43a20abcd5
commit e48a3027f6
2 changed files with 5 additions and 4 deletions

View File

@ -322,10 +322,7 @@ import WebKit
)
.styledContent
// webView.loadFileURL(ViewsPackage.bundleURL, allowingReadAccessTo: ViewsPackage.bundleURL)
// macOS isn't loading the resources at the baseURL here for some reason
// maybe it needs the `allowingReadAccessTo` permission?
webView.loadHTMLString(htmlString, baseURL: ViewsPackage.bundleURL)
webView.loadHTMLString(htmlString, baseURL: ViewsPackage.resourceURL)
}
}

View File

@ -5,4 +5,8 @@ public enum ViewsPackage {
public static var bundleURL: URL {
Bundle.module.bundleURL
}
public static var resourceURL: URL {
Bundle.module.resourceURL ?? bundleURL
}
}