LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Yury_T
User Name
Password

Notices


Rate this Entry

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.

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\" * )

" ';'
Posted in Uncategorized
Views 656 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration