Skip to content

Commit

Permalink
Fix bug preventing usage of query params in file URLs
Browse files Browse the repository at this point in the history
We can create HTML files whose content depends on
query params. Then we can set quicklookurl to
`file:///path/to/file.html?param=value`. This didn't
work so far because the URL string didn't end in `.html`
and thus, the extra pane decided to not render it at all.
We fix this bug by considering only the "path" component
of the URL to check whether it is an HTML file.
  • Loading branch information
mr-pennyworth committed Aug 8, 2024
1 parent 89756e2 commit a43a9b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions AlfredExtraPane.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.8;
MARKETING_VERSION = 0.2.9;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = mr.pennyworth.AlfredExtraPane;
Expand All @@ -438,7 +438,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.8;
MARKETING_VERSION = 0.2.9;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = mr.pennyworth.AlfredExtraPane;
Expand Down
2 changes: 1 addition & 1 deletion AlfredExtraPane/Pane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Pane {
log("failed to read '\(url)' as text file")
}
} else if url.isFileURL {
if url.absoluteString.hasSuffix(".html") {
if url.path.hasSuffix(".html") {
let dir = url.deletingLastPathComponent()
webView.loadFileURL(url, allowingReadAccessTo: dir)
} else {
Expand Down

0 comments on commit a43a9b7

Please sign in to comment.