Restrict browser command

This commit is contained in:
RetGal 2021-02-26 10:16:21 +01:00
parent 4613bdc45c
commit a5fcee57ec
3 changed files with 5 additions and 3 deletions

View File

@ -1,2 +1,4 @@
#!/bin/sh
exec snapctl user-open "$@"
case "$@" in http*://)
snapctl user-open "$@"
esac

View File

@ -273,7 +273,7 @@ public class Assistant implements Configurable<AssistantConfiguration>, Clipboar
help.addActionListener(ev1 -> {
if (isSnapped()) {
try {
new ProcessBuilder("dayon.browser", getQuickStartURI(FrameType.ASSISTANT).toString()).start();
new ProcessBuilder("/snap/bin/dayon.browser", getQuickStartURI(FrameType.ASSISTANT).toString()).start();
} catch (URISyntaxException | IOException ex) {
Log.warn("Help Error!", ex);
}

View File

@ -262,7 +262,7 @@ public abstract class BaseFrame extends JFrame {
private static void browse(URI uri) {
try {
if (isSnapped()) {
new ProcessBuilder("dayon.browser", uri.toString()).start();
new ProcessBuilder("/snap/bin/dayon.browser", uri.toString()).start();
} else if (Desktop.isDesktopSupported()) {
final Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)) {