change title of extension - any easy persistent way that survives updates?

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

Lew Rockwell Fan

change title of extension - any easy persistent way that survives updates?

Unread post by Lew Rockwell Fan » 2017-06-15, 23:04

Summary:
Is there any good way to change the titles of extensions? I use text mode in the UI. Some extensions have absurdly long names, obviously written by devs who use icons, and hog space on my tool bars. Examples: "Advanced Night Mode", "Youtube Video and Audio Downloader".

Background:
With menu items I use Menu Wizard, but that doesn't work for extension buttons. It used to be possible to download the xpi of an extension, carefully edit internal stuff and then install it from the modified local file. And, at least some of the time, that would work. But then it breaks every time the extension updates. Which means you have to do it all over again.

Ideally, I'd love to be able to set text/icon/both for each item separately, and control text, icon, & keybinding, but that must be hard to implement, because NOBODY does it that way. It would be nice to be able to drag a button into a menu also, but that can be Rube-Goldberged with 9menu and xdotool for example if the button can be assigned a keybinding so that xdotool can command it.

In FFx, at least, there are some extensions that show a button even on toolbars set to show text. Which suggests that the icon must be used as a fallback option if the title isn't properly set. Which, if true, suggests that it might be possible to have text/icon control on a per extension basis by setting the title IMproperly on the ones you want to show an icon, but I haven't explored that. If a button has or can be assigned a key-binding, I could use the extension "External Application Buttons" to call a script to use xdotool to call the extension, and name the button anything I wanted, but not all extensions have key-bindings or can be assigned one, and there is a performance penalty in that approach.

And all these round-about ways have a tendency to break on update. Any relevant suggestions are welcome.

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: change title of extension - any easy persistent way that survives updates?

Unread post by adesh » 2017-06-16, 06:19

Maybe you can write a script which reads the extensions directory and renames any extensions with long names, change icons etc. Whenever you update your extensions, you can run this script and you are all set. Since there are standard ways to define names and icons for extensions, once written you'll hardly have to modify your script ever.

Lew Rockwell Fan

Re: change title of extension - any easy persistent way that survives updates?

Unread post by Lew Rockwell Fan » 2017-06-17, 02:16

Thank you. I may have to do that if nothing more turnkey is suggested.

Lew Rockwell Fan

Re: change title of extension - any easy persistent way that survives updates?

Unread post by Lew Rockwell Fan » 2017-06-17, 06:14

One thing that does NOT work is . . .

uh . . . well, I had to come back and edit this post. One thing that does NOT work is failing to read the very long man page of zip. OK, I didn't realize you had to change PWD before zipping with zip or it nests the files you are zipping in a copy of every directory (not the content, just the directory) in the path all the back to / before zipping. Talk about an unintuitive default behavior. Anyway, I changed the offending strings with regexxer, zipped the files with zip (and finally got it right) and reinstalled an extension. Works great. OK, that part I can script.

If I knew where the xpi files were kept, I could probably automate checking for a new version and downloading the new xpi with wget or curl. But I have no idea how to deal with urls like
https://addons.palemoon.org/?component= ... ion=latest
in a script.

Lew Rockwell Fan

Re: change title of extension - any easy persistent way that survives updates?

Unread post by Lew Rockwell Fan » 2017-06-17, 09:06

OK, got that figured. Trick is to use:
wget --content-disposition -A xpi link_copied_from_the_button_on_the_web_page

I've only thought of kludgy ways to see if an update is needed:

- download the file and compare the version numbers
- maybe it will update normally and break the renaming, in which case, run the script.

The first seems a profligate abuse of bandwidth and the second seems inelegant, but, hey, gettin' there. If I get it working I'll post it.

JustOff

Re: change title of extension - any easy persistent way that survives updates?

Unread post by JustOff » 2017-06-17, 11:34

Lew Rockwell Fan wrote:I've only thought of kludgy ways to see if an update is needed
Open Browser Console (Ctrl+Shif+J), make sure that Net->XHR is selected, go to Add-ons Manager, click on "Check for updates" and look at requests to the https://addons.palemoon.org/integration ... nal/update in Browser Console - there will be all you need to write script for update checking.

Lew Rockwell Fan

Re: change title of extension - any easy persistent way that survives updates?

Unread post by Lew Rockwell Fan » 2017-06-17, 17:35

Thank you. Pressed clear to reduce the noise. Made sure XHR was checked on the dropdown menu just to the right of "Net". Right clicked on an extension in Add-ons, clicked "Find updates". Back to Browser Console - all I see is this:

usingOldMemoryReporter err=TypeError: Cc['@mozlla.org/memory-reporter-manager;1'] is undefined
TypeError: addon is null

But Browser Console seems to be a rather tricky thing. Can't see the logic of why the tabs sometimes change color when I click them and sometimes don't. And XHR keeps getting unchecked spontaneously.

If I could figure out how to wget the directory the xpi is kept in, I could just check the version number and then get the xpi if it has changed. I could just get the xpi unconditionally, and do the comparison locally of course. Purely from my own perspective that would work fine, but I'm thinking downloading a file that is 2 or 3 mb every day or so, when, in principle, I should be able to just download a directory that would be maybe 4 kb to check the NAME of the file is abusing somebody's bandwidth. If I make this work and publish it, and some other people start using it, the effect is multiplied by however many of us there are. I can add a pseudo-random interval to the check interval to spread it out of course. Maybe I'm being obsessive. Let's say 5 extensions to shorten the titles at 3 mb apiece. Let's guess 500 people use it. Not likely, I know. That's about a gig and a half of extra traffic per day. Seems to me like that would be enough to be a concern, but what do I know, I've never run a server.

Davesnothere

Re: change title of extension - any easy persistent way that survives updates?

Unread post by Davesnothere » 2017-06-25, 15:21

Lew Rockwell Fan wrote: ....It used to be possible to download the xpi of an extension, carefully edit internal stuff, and then install it from the modified local file.

And, at least some of the time, that would work.

But then it breaks every time the extension updates, which means you have to do it all over again....
Yes, I have encountered this too, and my workaround is to also change the cryptic ID string of the extension (inside of the install.rdf file) to something different (and not so cryptic, to make the destination folder more easily searchable from the external file system, even though I know where to expect it to be anyway).

Sure, doing this breaks the extension updating again, but then everything stays as I leave it, until I decide to manually get and modify any new version which may come along.

But I now have complete control over the updating of any extension where I have done this.

I have developed and use a few extensions of my own too, but not published them, and they have the exact same behaviour in that regard, because their ID is not known to AMO nor to the PM extension site.

MRCS4

Re: change title of extension - any easy persistent way that survives updates?

Unread post by MRCS4 » 2017-09-04, 14:24

Lew, thank you. You gave me the hints I needed to shorten some of the button labels.

I like the way Custom Buttons³ makes this so easy but, unfortunately, not all of them are from their site. I have been slowly, very slowly, customizing PM. My highly customized Opera 11.64 still works well in most cases, and I'm not willing all at once to put in that much time, work and learning all over again, especially at this late stage. A lot of this seemed much easier under Opera, or maybe it's that I've been using it since the demise of Netscape. I hope that modifying the skin that's closest to what I'd like (Maxi3) isn't too difficult.

Locked