how to add to right click context menu?

83 views
Skip to first unread message

John Moses

unread,
Jul 12, 2014, 1:13:42 AM7/12/14
to breac...@googlegroups.com
Hello,
Could someone please point out a snippet of code to add to the right click context menu?  I have looked in core and mod_strip and it did not jump out to me.

Thanks.
John

Stanislas Polu

unread,
Jul 12, 2014, 1:34:01 AM7/12/14
to John Moses, breac...@googlegroups.com
Hi John!

You can look for 'context_menu' in mod_strip's 'lib/tabs.js'

Basically you need to register a handler and the handler get called when the rigt click happens to populate the menu with strings + callbacks that will get called if the user clicks.

You can look for the same string in breach_core to see how it's hooked up there.

Hope it helps!
--
You received this message because you are subscribed to the Google Groups "breach-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to breach-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
-stan

---
+1 415 216 5700 | @spolu

John Moses

unread,
Jul 15, 2014, 3:27:25 PM7/15/14
to Stanislas Polu, breac...@googlegroups.com
It did help.  Now I am running into a problem where the context menu items on a new tab but once I go to a URL the context menu items are no longer there.  Do I need to listen for a URL change and reattach the menu items?

Thanks.

Stanislas Polu

unread,
Jul 15, 2014, 3:31:41 PM7/15/14
to John Moses, breac...@googlegroups.com
Hmmm no normally your context menu handler is called for any tab once you registered it. Have you tried logging stuff there?
Can you point to some code?

-stan

--
Stanislas Polu

Mo: +1 415 216 5700 | Tw: @spolu 
Reply all
Reply to author
Forward
0 new messages