stopgap solution for users of 'non-palemoon' extensions which stopped working with 29.2.0
Posted 04-28-2021 at 03:10 AM by Yury_T
The solution is, of course, adding Palemoon's id to install.rdf of extension in question.
However, I, for example, use about 35 extensions, almost all of them 'problematic', so doing 'the thing' by hand and one by one would get tedious.
So I've put together the following bash script for this. It's linux-specific and rather crude and it doesn't clean up in /tmp, but it served its purpose for me.
It will unpack everything XPI in the current directory, and if there wasn't palemoon's id in install.rdf already, it will put it there and repack the extension with new archive name. New XPIs are collected in /tmp/eee, and you'll HAVE to reinstall them. The script itself changes nothing in the profile directory.
Caveat: as you see, the script's supposed to work from the profile directory, where there may be unpacked extensions, too - those it will leave untouched. I had only four of those, so it wasn't a problem for me. You'll have to do yours by hand or modify the script.
And if you have all of your "problematic" extensions (.xpi files) in one place, you should be fine.
However, I, for example, use about 35 extensions, almost all of them 'problematic', so doing 'the thing' by hand and one by one would get tedious.
So I've put together the following bash script for this. It's linux-specific and rather crude and it doesn't clean up in /tmp, but it served its purpose for me.
It will unpack everything XPI in the current directory, and if there wasn't palemoon's id in install.rdf already, it will put it there and repack the extension with new archive name. New XPIs are collected in /tmp/eee, and you'll HAVE to reinstall them. The script itself changes nothing in the profile directory.
Caveat: as you see, the script's supposed to work from the profile directory, where there may be unpacked extensions, too - those it will leave untouched. I had only four of those, so it wasn't a problem for me. You'll have to do yours by hand or modify the script.
And if you have all of your "problematic" extensions (.xpi files) in one place, you should be fine.
Code:
#! /bin/sh cd ~/.moonchild\ productions/pale\ moon/your_profile_dir_name/extensions/ || (echo '??? no profile?'; exit 111) ttt='/tmp' eee='/tmp/eee' mkdir -p "$ttt" "$eee" find . -type f -maxdepth 1 -name '*.xpi' -exec sh -c " unzip -o \"{}\" -d \"${ttt}/{}/\" cat \"${ttt}/{}/\"install.rdf | awk '\ BEGIN {done=0}. /<\/em:targetApplication>/ && (0==done) \ { print \$0 printf(\" ^<!-- PaleMoon -->\\n\ ^<em:targetApplication>\\n\ ^ <Description>\\n\ ^ <em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>\\n\ ^ <em:minVersion>25.*</em:minVersion>\\n\ ^ <em:maxVersion>30.*</em:maxVersion>\\n\ ^ </Description>\\n\ ^</em:targetApplication>\\n\") done=1 next } // {print \$0} ' > \"${ttt}/{}/\"install.rdf1 nnn=\` echo {} | awk -F '.xpi' '{print \$1}' | awk -F './' '{print \$2}' \`'._[with_palemoon_id]_.xpi' ( egrep --silent '{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}' \"${ttt}/{}/\"install.rdf \ && ( rm \"${ttt}/{}/\"install.rdf1 ) \ ) \ || ( mv \"${ttt}/{}/\"install.rdf1 \"${ttt}/{}/\"install.rdf \ && cd \"${ttt}/{}/\" && zip -gr9 \"${eee}/\$nnn\" * ) " ';'
Total Comments 0