var evt = document.createEvent("MouseEvent");
evt.initMouseEvent("click", 1, 1, window, 1, 10, 50, 10, 50, 0, 0, 0, 0, 2, null);
Above I have created the MouseEvent but not sure how it should be dispatched to the tabbrowser so that it will display the appropriate context menu (filtered for what my selection is).
Thanks,
Todd
On 2/10/06, Matthew Waymost <
[EMAIL PROTECTED]
> wrote:
I think the reason you're getting a long context menu is because when you right click in the context area, what you right click on determines what items in the menu get hidden. I would surmise that by calling it the way you do, you're getting everything unfiltered. In browser.js, you'll find an object called nsContextMenu, which has all that code. I haven't dug through it recently, so I can't tell you exactly what you need, but it should point you in the right direction.
HTH, MattOn 2/10/06, Todd Long < [EMAIL PROTECTED]> wrote:Hey, Soyapi. Thanks for the link but it isn't exactly what I was looking for (some nice obfuscated code though). What I'm trying to do is get the Firefox context menu to popup and not a custom popup menu.
var evt = document.createEvent("MouseEvent");
evt.initMouseEvent("click", 1, 1, window, 1, 10, 50, 10, 50, 0, 0, 0, 0, 2, null);
document.popupNode=evt.target;
var cacm = document.getElementById ("contentAreaContextMenu")
cacm.showPopup(getBrowser(), evt.clientX, evt.clientY, "context", "bottomleft", "topleft");
Here is some code I have. But when this gets executed it pops up a loooong context menu with about every option available. I need to replace what ever click this was executed to the right-click (button 2). Any other thoughts on this? Thanks for all the help!
Thanks,
ToddOn 2/10/06, Soyapi Mumba < [EMAIL PROTECTED]> wrote:
Todd Long wrote:
> Is it possible to programmatically open the context menu
> (contentAreaContextMenu)? Basically, I just want to have the ability to
> send a right-click MouseEvent to the tabbrowser when a certain action is
> performed. I wasn't quite sure how to piece the code below to achieve
> this behaviour.
I haven't looked at how they do it but that's what Hyperwords does. Check it out
http://www.hyperwords.net/
- Soyapi
--
Soyapi Mumba
http://soyapi.blogspot.com
http://configuru.sourceforge.net
+265 (0) 9953 449
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners
_______________________________________________ Project_owners mailing list [email protected] http://mozdev.org/mailman/listinfo/project_owners
