diff --git a/Frameworks/RSCore/RSCore/AppKit/WebViewWindowController.swift b/Frameworks/RSCore/RSCore/AppKit/WebViewWindowController.swift index 7ce3d4734..943d83702 100644 --- a/Frameworks/RSCore/RSCore/AppKit/WebViewWindowController.swift +++ b/Frameworks/RSCore/RSCore/AppKit/WebViewWindowController.swift @@ -24,4 +24,14 @@ public final class WebViewWindowController: NSWindowController { window!.title = title } + + public func displayContents(of path: String) { + + // We assume there might be images, style sheets, etc. contained by the folder that the file appears in, so we get read access to the parent folder. + + let fileURL = URL(fileURLWithPath: path) + let folderURL = fileURL.deletingLastPathComponent() + + webview.loadFileURL(fileURL, allowingReadAccessTo: folderURL) + } }