How to overlay the tab context menu?

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4980
Joined: 2015-12-09, 15:45
Contact:

How to overlay the tab context menu?

Unread post by moonbat » 2021-02-04, 14:51

I looked at the code for Tab Mix Plus and found it adds items to a popupset called mainPopupSet.

I'm trying it like so -

Code: Select all

	<popupset id="mainPopupSet">
		<menupopup id="mymenu">
			<menuitem id="mnu-myext" label="my menu"/>
		</menupopup>
	</popupset>
but nothing shows up. This overlay is applied to browser.xul, as is the one in Tab Mix Plus.
"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
FranklinDM
Add-ons Team
Add-ons Team
Posts: 580
Joined: 2017-01-14, 02:40
Location: Philippines
Contact:

Re: How to overlay the tab context menu?

Unread post by FranklinDM » 2021-02-04, 15:02

The ID of the menu popup in your extension's overlay should match the ID of the target menu popup where the new menu item will be included.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<overlay id="test-browser-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <popupset id="mainPopupSet">
        <menupopup id="tabContextMenu">
            <menuitem id="mnu-myext" label="my menu"/>
        </menupopup>
    </popupset>
</overlay>
Last edited by FranklinDM on 2021-02-04, 15:32, edited 1 time in total.

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

Re: How to overlay the tab context menu?

Unread post by moonbat » 2021-02-04, 15:25

Got it, thanks.
"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

Locked