mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
try to load htmlString on mac app
This commit is contained in:
parent
93d3485e40
commit
43a20abcd5
2 changed files with 18 additions and 15 deletions
|
|
@ -149,7 +149,7 @@ import WebKit
|
|||
}
|
||||
}()
|
||||
|
||||
let fontFamily = fontFamilyValue.flatMap { WebFont(rawValue: $0) } ?? .inter
|
||||
let fontFamily = fontFamilyValue.flatMap { WebFont(rawValue: $0) } ?? .system
|
||||
|
||||
webView.loadHTMLString(
|
||||
WebReaderContent(
|
||||
|
|
@ -308,22 +308,24 @@ import WebKit
|
|||
}
|
||||
}()
|
||||
|
||||
let fontFamily = fontFamilyValue.flatMap { WebFont(rawValue: $0) } ?? .inter
|
||||
let fontFamily = fontFamilyValue.flatMap { WebFont(rawValue: $0) } ?? .system
|
||||
|
||||
webView.loadHTMLString(
|
||||
WebReaderContent(
|
||||
item: item,
|
||||
articleContent: articleContent,
|
||||
isDark: NSApp.effectiveAppearance.name == NSAppearance.Name.darkAqua,
|
||||
fontSize: fontSize(),
|
||||
lineHeight: lineHeight(),
|
||||
maxWidthPercentage: maxWidthPercentage(),
|
||||
fontFamily: fontFamily,
|
||||
prefersHighContrastText: prefersHighContrastText
|
||||
)
|
||||
.styledContent,
|
||||
baseURL: ViewsPackage.bundleURL
|
||||
let htmlString = WebReaderContent(
|
||||
item: item,
|
||||
articleContent: articleContent,
|
||||
isDark: NSApp.effectiveAppearance.name == NSAppearance.Name.darkAqua,
|
||||
fontSize: fontSize(),
|
||||
lineHeight: lineHeight(),
|
||||
maxWidthPercentage: maxWidthPercentage(),
|
||||
fontFamily: fontFamily,
|
||||
prefersHighContrastText: prefersHighContrastText
|
||||
)
|
||||
.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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ struct WebReaderContent {
|
|||
</head>
|
||||
<body>
|
||||
<div id="root" />
|
||||
<div>HIIIIII</div>
|
||||
<div id='_omnivore-htmlContent' style="display: none;">
|
||||
\(articleContent.htmlContent)
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue