Skip to content

Commit

Permalink
Open file in browser if is url (JabRef#10480)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr authored Oct 12, 2023
1 parent 3a8f908 commit a97d8a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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

0 comments on commit a97d8a9

Please sign in to comment.