-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathbrowser-ext
More file actions
executable file
·40 lines (35 loc) · 1.49 KB
/
browser-ext
File metadata and controls
executable file
·40 lines (35 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#
# Copyright (C) 2025 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This should be eventually get shared across projects:
# https://issues.redhat.com/browse/INSTALLER-3755
# Get the default browser for the 'https' protocol
DEFAULT_BROWSER=$(xdg-mime query default x-scheme-handler/https)
URL="${1/extlink/https}"
# If Firefox is the default browser, use the custom profile
if [[ "$DEFAULT_BROWSER" == "org.mozilla.firefox.desktop" ]]; then
# Create a temporary Firefox profile
PROFILE_DIR="/tmp/anaconda-extlink-firefox-profile"
mkdir -p "$PROFILE_DIR"
# Copy the custom user.js for the Firefox settings
cp /usr/share/anaconda/firefox-theme/extlink/user.js "$PROFILE_DIR/"
# Launch Firefox with the custom profile
/usr/bin/firefox --profile "$PROFILE_DIR" --no-remote "$URL"
else
# For any other browser, use xdg-open
xdg-open "$URL"
fi