User Agent Status removed my added toolbar

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

Moderators: FranklinDM, Lootyhoof

Goodydino
Keeps coming back
Keeps coming back
Posts: 820
Joined: 2017-10-10, 21:20

User Agent Status removed my added toolbar

Unread post by Goodydino » 2022-10-08, 21:57

The extension User Agent Status suddenly removed my added toolbar and kept removing it until I got rid of it. I suggest not using that extension if you added a toolbar.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-09, 01:26

Hi, extension author here. I can't reproduce this problem in both my current profile and a fresh one. Can you tell me what add-ons and theme you use? Thanks.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

Michaell
Lunatic
Lunatic
Posts: 282
Joined: 2018-05-26, 18:13

Re: User Agent Status removed my added toolbar

Unread post by Michaell » 2022-10-09, 02:26

Already had UAS so I added a toolbar just to test and put some buttons on it. It stayed, even after restart.

jobbautista9, he posted a lot of that info in the other topic. He will have to tell you more about how he narrowed it down to UAS.
Win10home(1709), PM33.0.0-portable as of Feb 1, '24

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-09, 02:51

Yeah, I realized now (can a moderator please merge these two threads together? Thanks). It seems that it doesn't matter what add-ons you have installed since Goodydino said it also happens in a fresh profile.

Goodydino, can you test if it happens too in the official Windows or Linux builds? Also please detail how you reproduce the problem, like a screen recording or something. Here's my screen recording trying to reproduce the issue in a fresh profile with the mainline GTK3 Linux build: https://job.tilde.team/palemoon-uas.mp4

EDIT: Also please try using the latest version of the add-on, as I noticed in your troubleshooting info that you were using 1.3.0. 1.4.0 fixed a bug caused by a hack I did in 1.3.x.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

Goodydino
Keeps coming back
Keeps coming back
Posts: 820
Joined: 2017-10-10, 21:20

Re: User Agent Status removed my added toolbar

Unread post by Goodydino » 2022-10-09, 06:36

I am using White Star (for Mac) but it can take the same themes and extensions. UAS was fine until this morning. I had been using it for a few weeks. I have no idea why it started acting up, but it did even in a new profile. It did not matter what theme I was using. Even with the default theme, I had the same problem. In safe mode, same thing until I removed the extension completely.

Michaell
Lunatic
Lunatic
Posts: 282
Joined: 2018-05-26, 18:13

Re: User Agent Status removed my added toolbar

Unread post by Michaell » 2022-10-09, 07:36

Well, I updated UAS to 1.4 (from 1.2) and guess what - the added toolbar is gone. The bar still goes missing now after going back to 1.2.
Win10home(1709), PM33.0.0-portable as of Feb 1, '24

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-09, 08:42

I made another fresh profile, added a toolbar with only the zoom controls as its contents, installed 1.2.0, restarted, no toolbars lost. Upgraded to 1.4.0 (skipped 1.3.x), restarted, still no toolbars lost. I really can't reproduce this problem you guys are seeing... :thumbdown:
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 933
Joined: 2021-01-26, 11:18

Re: User Agent Status removed my added toolbar

Unread post by Kris_88 » 2022-10-09, 09:51

jobbautista9 wrote:
2022-10-09, 08:42
I really can't reproduce this problem you guys are seeing... :thumbdown:
I also failed to reproduce the problem. However, I see that you do not isolate your scripts from the context of the window in which they are injected. And this can give rise to unpredictable interference with window scripts and other add-ons. For example, you have a DefineGlobalVars() function, declared in the context of the window. What do you think will happen if another add-on also has such a function? Or, for example, "Const {classes: Cc, interface: Ci, utils: Cu} = Components;". Are you sure that no script from another overlay will redefine your Cc,Ci,Cu?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35477
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: User Agent Status removed my added toolbar

Unread post by Moonchild » 2022-10-09, 11:00

Unless you absolutely need to work in the global space you should always wrap all your methods and variables in an extension object/prototype to avoid poisoning the global namespace with extension-specific methods and vars or overwriting global ones unintentionally.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-09, 12:12

That makes sense. I'm not a fan of the object-oriented way of programming, but looks like in the realm of extensions it makes perfect sense, since we're pretty much adding code to the browser. I'm now rewriting my extension to conform with OOP.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

Michaell
Lunatic
Lunatic
Posts: 282
Joined: 2018-05-26, 18:13

Re: User Agent Status removed my added toolbar

Unread post by Michaell » 2022-10-09, 14:49

This may be a long shot in terms of diagnosing, but just in case. I got the toolbar to stay after a restart by giving the toolbar a name that starts with a capital letter. (I noticed all the other menu entries that didn't disappear, including ones created by extensions had a name that started with a capital letter.) Could be something else happened but thought I'd mention it.
Win10home(1709), PM33.0.0-portable as of Feb 1, '24

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-09, 15:18

Can you give me the name you used for the custom toolbar?
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-09, 15:31

I've released a new version of the add-on, please check if it still screws up the added toolbars.

And please ignore the new menu items about UA compatibility mode in the right-click context menu. I haven't finished those yet, and I forgot to disable and comment them out before publishing this release... :oops:
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

Michaell
Lunatic
Lunatic
Posts: 282
Joined: 2018-05-26, 18:13

Re: User Agent Status removed my added toolbar

Unread post by Michaell » 2022-10-09, 15:54

Updated to 1.4.1 (from 1.2), restarted, toolbar gone again.

The names were things like "extra", "test", "extra2", "test2". Then the one that seemed to make it stay was "Uas-test". There are no other menu entries starting with "e" so that eliminates duplication as the cause ("T" is used for tabs on top). It's possible the name was not the real issue, especially since the update zapped the one with a capital (I was a little skeptical that that could be it anyway).
Win10home(1709), PM33.0.0-portable as of Feb 1, '24

Goodydino
Keeps coming back
Keeps coming back
Posts: 820
Joined: 2017-10-10, 21:20

Re: User Agent Status removed my added toolbar

Unread post by Goodydino » 2022-10-09, 19:06

I was already using a name starting with a capital letter, so that was not the issue. I thought maybe the name "Addon-bar" was something that the browser or an extension did not like, so changed it, but that had no effect.

Michaell
Lunatic
Lunatic
Posts: 282
Joined: 2018-05-26, 18:13

Re: User Agent Status removed my added toolbar

Unread post by Michaell » 2022-10-09, 20:26

Sorry to keep treading on Goodydino's thread. Can't edit previous post so just wanted to say the toolbar has come back. I did not do anything else deliberately related to this (still on 1.4.1).

OK tried in old PM29.4.4 with it's existing profile which had not had UAS installed before. Toolbar stayed after restart but after installing 1.4.1 and restarting, toolbar is gone. BUT THIS IS THE GOOD PART: I got suspicious and tried opening "New Window" and the toolbar IS showing there. That is behavior we've seen before. I don't recall details but it should be discussed here on the forum somewhere.

Also FWIW, confirmed toolbar stays put in current PM with clean portable install and default profile, no other extensions, no customized settings. (I won't be using this empty profile for actual browsing though.)
Win10home(1709), PM33.0.0-portable as of Feb 1, '24

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 933
Joined: 2021-01-26, 11:18

Re: User Agent Status removed my added toolbar

Unread post by Kris_88 » 2022-10-10, 07:22

Michaell wrote:
2022-10-09, 20:26
Also FWIW, confirmed toolbar stays put in current PM with clean portable install and default profile, no other extensions, no customized settings. (I won't be using this empty profile for actual browsing though.)
The problem may be in another add-on. Try turning them off one by one.
There is an assumption that this is a restartless add-on that uses the statusbar.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 782
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: User Agent Status removed my added toolbar

Unread post by jobbautista9 » 2022-10-10, 11:58

Wow, all of that OOP insanity I did in 1.4.1, and it still didn't fix the problem for you guys...

I still can't reproduce the problem btw, even with a lowercase name. Kris might be right; it could be another add-on causing the issue, because I really doubt my add-on can delete toolbars. I've like, triple-checked my extension's code.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: User Agent Status removed my added toolbar

Unread post by moonbat » 2022-10-10, 12:30

If any of the other addons on the toolbar is restartless, you'll run into this problem. I got around it by using Cozy Bookmarks Toolbar to shrink bookmarks to icons to free up space, then adding the addon icons to the end of it.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 933
Joined: 2021-01-26, 11:18

Re: User Agent Status removed my added toolbar

Unread post by Kris_88 » 2022-10-10, 12:59

jobbautista9 wrote:
2022-10-10, 11:58
Wow, all of that OOP insanity I did in 1.4.1, and it still didn't fix the problem for you guys...
The point is not an OOP, but an isolation of the context. This can be done in many ways...
And no, you have not eliminated everything. )
But I do not want to criticize too much. )

Locked