Fix Palemoon browser mouse scroll wheel goes through history when using Fluxbox

The solution

In my ~/.fluxbox/startup:

xinput set-button-map "$( xinput | awk -F'[=]' '/ouse/{print $2}' | awk '{print $1}' | head -n1 )" 1 2 3 4 5 6 7 0 0 &

The story

I installed Devuan ceres on a desktop workstation as part of my research into lightweight window managers. I installed my self-rolled dpkg of Palemoon (source on gitlab) because I have been actively reducing my use of upstream Firefox. When I scrolled up with the mouse wheel, the browser jumped back and forth in history. If the current tab in the browser has no previous pages, then the scrolling operates just fine.

Apparently I’m a unicorn. Nobody has had this exact problem in this environment before (Windows users of Firefox changing the about:config don’t count). Relevant xkcds include a tiny bit of xkcd#979 and a healthy dose of xkcd#1495.

I investigated many different methods to try to solve my problem. I tried changing the about:config settings in the browser (specifically mousewheel.default.action and similar) which did not solve my problem.

My next attempt involved file ~/.fluxbox/keys to assign commands to mouse button actions to reduce the effect they have in the window, which failed to suppress the undesirable actions.

I investigated using xbindkeys to control what is sent to the X server when it receives certain inputs. I even tried complicated guile logic, which actually seems quite nifty, but it just didn’t accomplish what I wanted in this case. I found an interesting example (secondary reference 3) where some toggling logic was shared, and I spent a lot of time trying to tinker with that.

I finally found what I was looking for on the Arch Wiki (primary reference 1), go figure. Those Arch folks know how to help a guy no matter the distro! You can use xinput to change what signals are sent to X from the device by remapping the buttons. You can suppress a button with 0.
The wiki helpfully explains how to find which device to modify. And then the series of numbers after that are the button mappings. So the first button, is mapped to the first number, and so on. If a button is mapped to 0, it is effectively ignored.

xinput set-button-map "$( xinput | awk -F'[=]' '/ouse/{print $2}' | awk '{print $1}' | head -n1 )" 1 2 3 4 5 6 7 0 0 &

In my example, I mask buttons 8 and 9. Using xev and xbindkeys -mk I learned that my mouse (a generic HP mouse since I’ve never cared about fancy peripherals) sends button 4 on scrolling up, and then button 8 and button 9 when stopping the scrolling up action. It was the button 8 (and 9) that were causing weird issues with the browser. When I mask the input with xinput as seen here, the scrolling operates completely normally and as expected.

The probable causes

I have been using this mouse with Xfce on Fedora for years, and the scrolling has never been a problem. I suspect my choice of installing all the packages myself on a Devuan netinst contributed to the problem. I had an issue with fonts on xscreensaver which was probably due to my minimal install. Perhaps Fluxbox does not perform some perfunctory task that desktop environments (DEs) do with sanitizing input. I don’t care, because Fluxbox has been quite satisfactory.

And as a side node, I haven’t found a debian-family “minimal” disc that can be used independently of a network, like the CentOS minimal disc image, only a netinst.

References

Primary

  1. Mouse buttons – ArchWiki [wiki.archlinux.org]

Secondary

  1. XBindKeys [nongnu.org]
  2. xbindkeysrc.scm [nongnu.org]
  3. [SOLVED] [xbindkeys] Advanced mouse binds? [linuxquestions.org]
  4. fluxbox-keys(5) Manual Page [fluxbox.org]

Commands/programs

xev – uesful to display info about keys are being pressed

xbindkeys -mk – same

xinput – manipulate mouse button mapping

Files

~/.fluxbox/keys

~/.xbindkeysrc

~/.xbindkeysrc.scm

Advertisements

Compile Pale Moon 28 on Fedora 27

Introduction

Pale Moon 28 was released on August 16, 2018. I package it myself on Fedora because I don’t see it in the fedora repositories, and plus I like the experience of assembling packages myself. For a basic compile (not in an rpm), you can follow these instructions.

Install dependencies

Install the whole set of packages listed on the Pale Moon site (reference 2) or CentOS7

sudo dnf -y install gtk2-devel dbus-glib-devel autoconf213 yasm mesa-libGL-devel alsa-lib-devel libXt-devel zlib-devel openssl-devel sqlite-devel bzip2-devel pulseaudio-libs-devel
sudo dnf -y groupinstall 'Development Tools'

Install the dependencies I found.

sudo dnf -y install GConf2-devel notification-daemon

Use autoconf 2.13

Pale Moon depends on autoconf 2.13. Thankfully, it’s in the Fedora repos, but changing the main autoconf link to point to this specific version will save a bunch of headache later. Be aware that this step exactly as shown will change your system’s default autoconf. I’m sure this is a crude way to do it, but aren’t build systems throwaway systems nowadays?

autoconfver="$( autoconf --version 2>/dev/null | awk 'NR==1 {print $NF*100;} END {print "0";}' | head -n1 )"
test ${autoconfver} -ne 213 &&amp test ${autoconfver} -gt 0 && sudo mv /usr/bin/autoconf /usr/bin/autoconf-${autoconver} 2>/dev/null ; sudo ln -sf autoconf-2.13 /usr/bin/autoconf

Fetch source

Pale Moon likes to compile in ~/pmsrc. Don’t change it. It just makes it easier.

mkdir ~/pmsrc ~/pmbuild
cd ~/pmsrc
git clone https://github.com/MoonchildProductions/UXP .

Prepare to compile

Use the recommended .mozconfig from the Pale Moon site (reference 2)

tf=~/pmsrc/.mozconfig
touch "${tf}"
cat <<'EOFMOZCONFIG' > "${tf}"
mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_OBJDIR=/home/$USER/pmbuild/
ac_add_options --enable-application=palemoon
 
ac_add_options --enable-optimize="-O2"
 
# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1
 
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --with-pthreads
 
ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-parental-controls
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater
 
ac_add_options --x-libraries=/usr/lib
EOFMOZCONFIG

Compile

These instructions include saving the output to a log file, but that’s not necessary.

mkdir ~/log
cd ~/pmsrc
{ time ./mach build && time ./mach package ; } | tee -a ~/log/pmsrc.$( date "+%F-%H%M%S" ).log
echo done

References

Weblinks

  1. https://bugzilla.mozilla.org/show_bug.cgi?id=1167201
  2. http://developer.palemoon.org/Developer_Guide:Build_Instructions/Pale_Moon/Linux#head:Fedora
  3. Compiling Pale Moon web browser on Fedora (published 2018-02-09)

Add user agent overrides in Pale Moon

Pale Moon is a wonderful web browser. I use it as a daily driver. Some websites think it is outdated and will actually send a page saying, “Your browser is outdated. Please update to a modern browser to use this site.”

I disagree with their assessment. Additionally, Pale Moon has the ability to change the user agent when talking to domains. You can just make a new entry in the about:config page.

general.useragent.override.deviantart.net Mozilla/5.0 (X11; Linux x86_64; rv:3.4) Goanna/20170101 PaleMoon/27.6.1
general.useragent.override.netflix.com Mozilla/5.0 (X11; Linux x86_64; rv:45.9) Gecko/20100101 Firefox/45.9

Just make a new entry with name: general.useragent.override.domain.com. And just experiment with the user agent string to send until you get it right for the site in question.

Compiling Pale Moon web browser on Fedora 27

<

Story

I like the traditional model of Firefox. This is easily represented in the current project Pale Moon. The upstream project does not currently provide instructions for compiling on Fedora 27. All the options they have documented are on their developer site: https://developer.palemoon.org/Developer_Guide:Build_Instructions/Pale_Moon/Linux.

You might think it is no big deal to download and compile an application. But when the application is still targeted for gcc4.9, it’s a little tricky to compile on the current Fedora which uses gcc7.

After consulting the Internet, I have assembled my instructions for compiling Palemoon on Fedora.

Compile palemoon on Fedora 27

# Install the whole set of packages listed on (primary ref 1) for CentOS7
sudo dnf -y install gtk2-devel dbus-glib-devel autoconf213 yasm mesa-libGL-devel alsa-lib-devel libXt-devel zlib-devel openssl-devel sqlite-devel bzip2-devel pulseaudio-libs-devel
sudo dnf -y groupinstall 'Development Tools'

# Install additional dependencies I found
sudo dnf -y install nspr-devel

# Use autoconf 2.13
autoconfver="$( autoconf --version 2>/dev/null | awk 'NR==1 {print $NF*100;} END {print "0";}' | head -n1 )"
test ${autoconfver} -ne 213 && test ${autoconfver} -gt 0 && sudo mv /usr/bin/autoconf /usr/bin/autoconf-${autoconver} 2>/dev/null ; sudo ln -sf autoconf-2.13 /usr/bin/autoconf

# Use the copr davidva/gcc49
sudo dnf -y copr enable davidva/gcc49
# fix the $releasever variable in the repo
sudo sed -i -r -e 's/-\$releasever-/-23-/;' /etc/yum.repos.d/_copr_davidva-gcc49.repo
sudo dnf -y install gcc49
# fix a minor library problem (primary ref 2)
pushd /opt/gcc-4.9.3/lib64/gcc/x86_64-fedoraunited-linux-gnu/4.9.3
sudo cp -p ../lib64/libgcc_s.so.1 .
sudo ln -s libgcc_s.so.1 libgcc_s.so
popd

# Fetch palemoon source
mkdir ~/pmsrc ~/pmbuild
cd ~/pmsrc
git clone https://github.com/MoonchildProductions/Pale-Moon.git .

# Prepare to compile
# use .mozconfig from (primary ref 1)
tf=~/pmsrc/.mozconfig
touch "${tf}"
cat <<'EOFMOZCONFIG' > "${tf}"
# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1

mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser

mk_add_options MOZ_OBJDIR=/home/$USER/pmbuild/

ac_add_options --enable-optimize="-O2 -msse2 -mfpmath=sse"
ac_add_options --with-pthreads

ac_add_options --disable-installer
ac_add_options --disable-updater

ac_add_options --enable-release
ac_add_options --enable-devtools
ac_add_options --enable-jemalloc
ac_add_options --enable-shared-js

ac_add_options --enable-strip

ac_add_options --x-libraries=/usr/lib
EOFMOZCONFIG

# Compile:
mkdir ~/log
cd ~/pmsrc
source /usr/bin/gcc49
{ time ./mach build ; } | tee -a ~/log/pmsrc.$( date "+%Y-%m-%d-%H%M%S" ).log
echo done

Future steps

Post these instructions on the fedora and palemoon fora.
Ask Pale Moon devs if these can be adapted and shared on Reference 1.

References

Weblinks

primary

  1. http://developer.palemoon.org/Developer_Guide:Build_Instructions/Pale_Moon/Linux
  2. ensure lib files are in right dir: https://serverfault.com/questions/266138/cannot-find-lgcc-s-from-gcc-3-4-on-unbuntu-11-04/266141#266141

auxiliary

  1. A great example and future reference http://ftp.nluug.nl/pub/os/Linux/distr/pclinuxos/pclinuxos/srpms/SRPMS.pclos/palemoon-27.0.3-1pclos2017.src.rpm
  2. https://build.opensuse.org/package/show/network/palemoon

Palemoon 64-bit for Linux and Flash Player Plugin

  1. Install Palemoon using the pminstaller.sh from http://linux.palemoon.org/download/installer/
  2. Visit the main page at https://get.adobe.com/flashplayer/otherversions/ or use this direct link: https://get.adobe.com/flashplayer/download/?installer=FP_27.0_for_Linux_64-bit_(.rpm)_-_NPAPI&stype=7768&standalone=1 and install it.
  3. Load the libraries in the directory Pale Moon looks in:
    sudo ln -s /usr/lib64/flash-plugin/libflashplayer.so /usr/lib/mozilla/plugins/
    

References

My links

  1. https://bgstack15.wordpress.com/2017/12/07/palemoon-64-bit-for-linux-and-google-talk-plugin/

Palemoon 64-bit for Linux and Google Talk Plugin

  1. Install Palemoon using the pminstaller.sh from http://linux.palemoon.org/download/installer/
  2. Visit gmail and initiate a call, which will cause it to prompt you to download the google talk plugin. Install it.
  3. Load the libraries in the directory Pale Moon looks in:
    pushd /usr/lib/mozilla/plugins 1>/dev/null 2>&1
    sudo ln -s ../../../../opt/google/talkplugin/libnpo1d.so
    sudo ln -s ../../../../opt/google/talkplugin/libnpgoogletalk.so
    popd 1>/dev/null 2>&1

    You don’t even need to close and re-open the browser!

You will still get the warning “Hangouts phone calls will temporarily stop working in Firefox.” When making an outgoing call, you can dismiss the warning. However, I was unable dismiss the warning when receiving a call, which means I was not able to receive calls. I don’t know how to fix that part.

Also, on occasion, it simply wouldn’t make an outgoing call. Just cancel and try again, and then it will work.

References

Weblinks

https://askubuntu.com/questions/906315/install-java-plugin-in-pale-moon-browser/906341#906341

Original research

rpmrebuild google-talkplugin_current_x86_64.rpm

Using Google Talk Plugin in Palemoon Portable in Wine on Linux

Overview

My main browser is Palemoon Portable which I run in Wine on GNU/Linux. I also use Gmail, Google Talk (the pre-Hangouts tool), and Google Voice.

In order to make and receive phone calls from my main web gmail page, I used this process.

  1. Install Adobe Flash Player for Firefox on Windows. I used the offline installer from the download link at Weblink 2.
    1. Used my Linux native Firefox to navigate to the normal Adobe flash player download page.
    2. Selected “Need Flash Player for different computer?”
    3. Selected Windows 7/Vista/XP and FP 25 for Firefox – NPAPI.
    4. From a terminal, I ran the following command and installed Flash like normal.wine ~/Downloads/install_flash_player.exe
  2. Install Google Talk plugin.
    1. Unfortunately the gmail link for “Download voice chat plugin” failed to complete. When I ran wine ~/Downloads/GoogleVoiceAndVideoSetup.exe from a terminal, I observed that the process failed because of some network issue related to wine:fixme:secur32:schannel_get_cipher_algid unknown algorithm 23
      fixme:secur32:schannel_get_mac_algid unknown algorithm 200

      I bet it has something to do with the way my GNU/Linux computers always have some long MAC address in my dhcp list instead of a normal 12-character value. I don’t know how to fix that, nor was I able to trick the installer to continue.
    2. So I had to install the Google Talk plugin manually.
      1. I used a Windows computer that already had a working environment of Google Talk for Palemoon Portable. I copied these files:C:\Users\bgstack15\AppData\Roaming\Mozilla\plugins\npgoogletalk.dll
        C:\Users\bgstack15\AppData\Roaming\Mozilla\plugins\npo1d.dll
        To location
        /usr/share/PMP257/Lib/Mozilla/Plugins
        Where /usr/share/PMP257 is my D:\PortableApps location.
      2. I also copied this entire directory:C:\Users\bgstack15\AppData\Local\Google\Google Talk Plugin\
        As the directory
        /usr/share/PMP257/Lib/Mozilla/Plugins/Google Talk Plugin/
      3. I set up the wine registry with a key and values from a registry file as seen below.tf=/usr/share/PMP257/Lib/Mozilla/Plugins/googletalk.reg
        touch "${tf}"; chmod 0644 "${tf}"
        cat << EOF > "${tf}"
        REGEDIT4
        [HKEY_CURRENT_USER\Software\Google\Google Talk Plugin]
        "CrashReporterKeyPath"=dword:00000000
        "D3DXRedistKeyPath"=dword:00000000
        "DriverBlacklistKeyPath"=dword:00000000
        "install_dir"="z:\\usr\\share\\PMP257\\Lib\\Mozilla\\Plugins\\Google Talk Plugin\\"
        "neven_lm_installed"=dword:00000001
        "neven_sft_installed"=dword:00000001
        "nven_mft_installed"=dword:00000001
        EOF
        regedit "${tf}"

        If the registry file does not import properly, try sticking a blank line after REGEDIT4. WordPress and the html <code> tag do not play nicely together with blank lines in code.

Conclusion

This entire process was made possible by the fantastic users of the Portableapps.com community: portablealpha, taosk8r, acamp, and robertcollier4. It was that one page (weblink 1), and my working but disused Windows installation that made this whole process possible.

Backstory

I realize I make life hard for myself, for using a web interface in a portable version of a small fork of a web browser in an emulator.

The story behind why I use this portable browser, in wine, on Linux, is this. When I first started getting on the Internet, I was a teenager and did not own my own computer. I had a flash drive, and I used it to store my personal files. I discovered PortableApps which let me use probably Firefox 2 or 3 from my flash drive. Even as I grew and got my own computers, I still kept my main web browser as a portable one so it would be relatively free from OS hooks so it was easy to transplant from system to system, as I migrated my main workstation. I built up a new installation every couple of years, hopping from Firefox 17 at one point to 27 to 33 to 38. After that, I switched to Palemoon 25 Portable and that is what I’m still on as of this post.

Now, 2016 was the Year of Linux on the Desktop for me, as I wanted to avoid the Windows 10 debacle. I had installed Korora 22 Cinnamon on a spare laptop in November of 2015 and from there made it my main system. In February of 2016 I copied over my Palemoon Portable install and it ran in Wine just fine! The only problem it had was it didn’t work with Google Voice.

This week I was trying to solve a VLC dlna problem where it was not finding my Plex server. I got frustrated with that (a bug that’s still unresolved https://bugs.launchpad.net/ubuntu/+source/libupnp/+bug/1571199) and transitioned into looking into the Google talk problem on Palemoon Portable.

References

Weblinks

  1. Entire portableapps thread explaining how to get a PortableApp to use Google Talk. http://portableapps.com/node/24945

Portablealpha on September 15, 2010 – 9:18pm

Adding Google Voice plugin

Just wanted to let people know how I got the Google Voice plugin to work so that I could use the “Call Phone” feature from within gmail. This is *not* elegant but it’s the only way I could figure it out because the target computer is behind some nasty firewalls (and the Google Voice installer isn’t allowed to call home to download its files).

1. Install the Google Voice plugin on your home computer.
2. Locate the Google Voice and Video Accelerator plugins in FF using about:plugins.
3. Copy those to your Firefox Portable plugins directory on the flash drive.
4. Locate the “Google Talk Plugin” folder on your hard drive and copy it to the flash drive (doesn’t matter where).

When you want to use Google Voice through Firefox Portable, run the exe in the Google Talk Plugin first, then start FFP and go to gmail. Note that once you exit gmail, it will stop the exe, so you’ll have to run it again manually if needed.

Anyone have any suggestions to automate this?

Taosk8r on June 11, 2011 – 1:42am

Oh good

I found this thread again.. I cant seem to find where ff 4.0 puts these.. the info I get is:

npgoogletalk.dll
application/googletalk

npgtpo3dautoplugin.dll
application/vnd.gtpo3d.auto

Is this even still relevant?

Acamp on October 21, 2011 – 3:13am

Fantastic!

Works like a charm!

You have to search your computer for those two files (real pain in the ass on newer windows machines because they try not to display any scary system files). Once windows can’t find it, click advanced, check include non-indexed, hidden and system files.

You also need to search for the folder “Google Talk Plugin” and copy that to the flash drive. It contains the executable that needs to be launched before Firefox is opened

Robertcollier4 on September 28, 2012 – 7:33am

Works without needing to load the EXE manually

Create the following directory structure if not already existing:
FirefoxPortable\Data\Plugins\
ChromePortable\App\Chrome-bin\Plugins
Palemoon-Portable\Lib\Mozilla\Plugins

Place the following files/folders in Plugins directory:
npgoogletalk.dll
npgtpo3dautoplugin.dll
“Google Talk Plugin” (complete folder)
“Google Talk Plugin Extras” (complete folder)

The files are located at:
DocsandSettings\Username\Local Settings\Application Data\Google\Google Talk Plugin\
DocsandSettings\Username\Application Data\Mozilla\plugins\

Then it will work and the EXE will automatically load from Gmail.

Robertcollier4 on September 30, 2012 – 2:02pm

Specify path in registry to load EXE automatically

Hi – there is one update. If you want the EXE to run automatically, you must add the following registry key with the proper path to googletalkplugin.exe so that it knows where to find it and load it automatically. It will work without adding the registry path – but if the registry path is not there as shown below then you must run the googletalkplugin.exe manually before loading the browser.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Google\Google Talk Plugin]
“install_dir”=”D:\\FirefoxPortable\\Data\\Plugins\\Google Talk Plugin\\”
“neven_sft_installed”=dword:00000001
“neven_mft_installed”=dword:00000001
“neven_lm_installed”=dword:00000001
“D3DXRedistKeyPath”=dword:00000000
“CrashReporterKeyPath”=dword:00000000
“DriverBlacklistKeyPath”=dword:00000000

  1. https://get.adobe.com/flashplayer/download/?installer=FP_25_for_Firefox_-_NPAPI&stype=5513&standalone=1
  2. Normal adobe flash player download page https://get.adobe.com/flashplayer/