use resourceURL for locating bundled web reader web resources
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,4 +5,8 @@ public enum ViewsPackage {
|
||||
public static var bundleURL: URL {
|
||||
Bundle.module.bundleURL
|
||||
}
|
||||
|
||||
public static var resourceURL: URL {
|
||||
Bundle.module.resourceURL ?? bundleURL
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user