mrclksr / linux-browser-installer

Script to install Linux browsers under a Linux chroot on FreeBSD
165 stars 25 forks source link

Opera support #25

Closed megastallman closed 1 year ago

megastallman commented 1 year ago

Hi guys! Thanks for a nice tool!

For peole living in totalitarian countries like me, where half of the internet is just broken, it would be nice to provide Opera browser. It has OperaVPN built in. I approve that it works absolutely fine in Linuxulator, with OperaVPN, sound and video. I've added it manually and can provide some configuration:

# cat /usr/local/share/applications/linux-opera.desktop 
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Opera Web Browser (Linux)
Comment=Access the Internet
Icon=/compat/ubuntu/usr/share/icons/hicolor/128x128/apps/opera.png
Exec=/usr/local/bin/linux-opera
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
StartupNotify=true
# cat /usr/local/bin/linux-opera
#!/bin/sh

chroot_path=/compat/ubuntu

get_pa_sock_path()
{
        PA_SOCK_PATH=$(sockstat | awk -v me=$(whoami) -F'[ \t]+' '
                $1 == me && $2 == "pulseaudio" && $6 ~ /native/ {
                        print $6;
                        exit 0
                }'
        )
}

get_pa_sock_path
if [ ! -S "$PA_SOCK_PATH" ]; then
        while killall pulseaudio; do
                sleep 0.5
        done
        pulseaudio --start
        get_pa_sock_path
fi
[ -S "$PA_SOCK_PATH" ] && export PULSE_SERVER=unix:$PA_SOCK_PATH
${chroot_path}/bin/opera
/compat/ubuntu # cat bin/opera 
#!/compat/ubuntu/bin/bash
#
# brave wrapper script from patovm04:
# https://forums.freebsd.org/threads/linuxulator-how-to-run-google-chrome-linux-binary-on-freebsd.77559/
#

export OPERA_PATH="/usr/lib/x86_64-linux-gnu/opera/opera"
export CHROME_WRAPPER="`readlink -f "$0"`"
export LD_LIBRARY_PATH=/usr/local/steam-utils/lib64/fakeudev
export LD_PRELOAD=/usr/local/steam-utils/lib64/webfix/webfix.so
export LIBGL_DRI3_DISABLE=1

exec -a "$0" "$OPERA_PATH" --no-sandbox --no-zygote --test-type --v=0 "$@"
# cat /etc/apt/sources.list.d/opera-stable.list
# This file makes sure that Opera Browser is kept up-to-date
# as part of regular system upgrades

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)

You may reuse it if you are interested to move further.

mrclksr commented 1 year ago

Hi @megastallman,

very nice :) Could you integrate the support for Opera into linux-browser-installer, and send me a pull request?

megastallman commented 1 year ago

Hi @mrclksr ! Please check https://github.com/mrclksr/linux-browser-installer/pull/26

To check, I've removed and recreated chroot. Also, after starting the browser, enable OperaVPN and visit myip.wtf to make sure that your exit IP is NOT your provider's.

mrclksr commented 1 year ago

Thank you very much for the pull request :) OperaVPN works like a charm.