Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open file in browser if is url #10480

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where exporting "XMP annotated pdf" without selecting an existing document would produce an exception. [#10102](https://github.com/JabRef/jabref/issues/10102)
- We fixed an issue where the "Enabled" column in the "Protected terms files" tab in the preferences could not be resized [#10285](https://github.com/JabRef/jabref/issues/10285)
- We fixed an issue where after creation of a new library, the new library was not focused. [koppor#592](https://github.com/koppor/jabref/issues/592)
- We fixed an issue where double clicking on an url in the file field would trigger an exception instead of opening the browser [#10480](https://github.com/JabRef/jabref/pull/10480)


### Removed
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private static void openIsbn(String isbn, PreferencesService preferencesService)

/**
* Open an external file, attempting to use the correct viewer for it.
* If the "file" is an online link, instead open it with the browser
*
* @param databaseContext The database this file belongs to.
* @param link The filename.
Expand All @@ -160,7 +161,7 @@ public static boolean openExternalFileAnyFormat(final BibDatabaseContext databas
String link,
final Optional<ExternalFileType> type) throws IOException {
if (REMOTE_LINK_PATTERN.matcher(link.toLowerCase(Locale.ROOT)).matches()) {
openExternalFilePlatformIndependent(type, link, filePreferences);
openBrowser(link, filePreferences);
return true;
}
Optional<Path> file = FileUtil.find(databaseContext, link, filePreferences);
Expand Down