DOM - Toggle Addons? Topic is solved

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

Moderators: FranklinDM, Lootyhoof

User avatar
fatboy
Astronaut
Astronaut
Posts: 558
Joined: 2017-12-19, 08:03
Location: Canada

DOM - Toggle Addons?

Unread post by fatboy » 2023-09-18, 14:19

Good Day Folks,

I am looking to find a way to toggle Swarth with a keybinding so that I can use Dorando the toggle the extension. However, I am trying to use DOM Inspector, but am unsuccessful, the only thing I am managing to inspect are web pages and nothing with the browser's GUI elements?

Trying to teach myself to fish here.

Thank You
Systemd Free - MX Linux, Antix Linux & Artix Linux

User avatar
opus_27
Apollo supporter
Apollo supporter
Posts: 36
Joined: 2020-06-16, 13:29

Re: DOM - Toggle Addons?

Unread post by opus_27 » 2023-09-18, 15:06

In DOM Inspector, try opening the File menu, then the Inspect Chrome Document fly-out. Then select the title of the Web page in the current tab and explore…

User avatar
jars_
Lunatic
Lunatic
Posts: 399
Joined: 2016-12-27, 00:12

Re: DOM - Toggle Addons?

Unread post by jars_ » 2023-09-18, 15:59

Look in file swarth-1.1.0.xpi\content\browserOverlay.xul

Code: Select all

   <!-- Commands -->
    <commandset id="mainCommandSet">
        <command id="Swarth:ToggleEnabled"
                 oncommand="Swarth.prefs.toggleEnabled();"/>
        <command id="Swarth:OpenPreferences"
                 oncommand="Swarth.openPreferences();"/>
        <command id="Swarth:HandleButton"
                 oncommand="Swarth.onCommand(event);"/>
    </commandset>
    ... etc
command= ... or oncommand=... search what you need.

Code: Select all

Swarth.prefs.toggleEnabled();
:?:

but better way is: CustomButtons and Attribute Inspector button

User avatar
fatboy
Astronaut
Astronaut
Posts: 558
Joined: 2017-12-19, 08:03
Location: Canada

Re: DOM - Toggle Addons?

Unread post by fatboy » 2023-09-18, 16:15

Thank You opus_27 and jars_

Your replies were truly beautiful.

@opus_27, will definitely look into that, I have very little experience with DOM Inspector. Will try this on Pale Moon and Sealion.

@jars_ Your last code snippet did the trick! Thank You

SOLUTION:

Code: Select all

 Swarth.prefs.toggleEnabled(); 
Systemd Free - MX Linux, Antix Linux & Artix Linux