MozillaZine

[Menu Wizard] What am I doing wrong, here?

Talk about add-ons and extension development.
iriscal
 
Posts: 2
Joined: August 31st, 2017, 5:33 pm

Post Posted August 31st, 2017, 5:40 pm

I'm trying to use Menu Wizard to add a context menu item to search for images on IQDB. Is there something I'm doing wrong here? Basically I just want to concatenate a string containing the search URL and the URL of the image targeted by the context menu event, but nothing is happening when I click this menu item.

Image
Image

morat
 
Posts: 2363
Joined: February 3rd, 2009, 6:29 pm

Post Posted August 31st, 2017, 10:39 pm

Try this:

Code: Select all
if (gContextMenu.onImage) {
  urlSecurityCheck(gContextMenu.mediaURL, gContextMenu.principal);
  openUILinkIn("https://iqdb.org/?url=" + encodeURIComponent(gContextMenu.mediaURL), "tab");
} else if (gContextMenu.onLink) {
  urlSecurityCheck(gContextMenu.linkURL, gContextMenu.principal);
  openUILinkIn("https://iqdb.org/?url=" + encodeURIComponent(gContextMenu.linkURL), "tab");
}

Menu Wizard
http://addons.mozilla.org/firefox/addon/508352

Menu Wizard (support thread)
viewtopic.php?f=48&t=2828771

Reference
http://dxr.mozilla.org/mozilla-release/ ... extMenu.js

iriscal
 
Posts: 2
Joined: August 31st, 2017, 5:33 pm

Post Posted September 2nd, 2017, 6:39 pm

Works perfectly. Guess it's a little more in-depth than I thought it would be. (t. C# dev) Thanks!

morat
 
Posts: 2363
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 2nd, 2017, 7:33 pm

You're welcome.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest