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

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

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

Post by iriscal »

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: 6404
Joined: February 3rd, 2009, 6:29 pm

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

Post by morat »

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)
http://forums.mozillazine.org/viewtopic ... &t=2828771

Reference
http://dxr.mozilla.org/mozilla-release/ ... extMenu.js
iriscal
Posts: 2
Joined: August 31st, 2017, 5:33 pm

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

Post by iriscal »

Works perfectly. Guess it's a little more in-depth than I thought it would be. (t. C# dev) Thanks!
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

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

Post by morat »

You're welcome.
Post Reply