• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    [JS] Old Opera. How to open popup window(It's linked to toolbar button) from context menu item?

    Opera add-ons
    3
    3
    4108
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • arhangelsoft
      arhangelsoft last edited by

      Greetings!

      I wrote code:
      window.addEventListener("load", function ()
      {
      //Tool bar button
      var btn;
      var btnProps =
      {
      title : "MENU ACTION CONTEXT",
      icon : "images/png/icon32.png",
      popup :
      {
      href : "addWindow.html",
      height : 420,
      width : 920
      }
      }
      btn = opera.contexts.toolbar.createItem(btnProps);
      opera.contexts.toolbar.addItem(btn);

      //Context menu item
      if (opera.contexts.menu)
      {
      	var menu = opera.contexts.menu;
      	var itemProps =
      	{
      		title : 'MENU ACTION CONTEXT',
      		contexts: ['all'],
      		icon: 'images/png/icon16.png',
      		onclick : function (event)
      		{
      		 /*
      

      I'm need Open this:
      var btnProps =
      {
      title : "MENU ACTION CONTEXT",
      icon : "images/png/icon32.png",
      popup :
      {
      href : "addWindow.html",
      height : 420,
      width : 920
      }
      }

      FROM HERE. How to do that?
      */
      }
      }
      var item = menu.createItem(itemProps);
      menu.addItem(item);
      }
      else
      {
      console.error('Context Menu API not supported.');
      }
      }, false);

      The same code on pastebin: http://pastebin.com/v3Szi44U

      ToolBar button linked with my popup window(named AddWindow.html), by click on it, works great. Bum I'm need do the same from context menu item(open that popup window).

      How to do that?

      I already have plugins for newest Opera editions, but still need support Opera 12.16, that uses many users.

      Please, help me!

      With best regards, Alexandr.

      P.S. Sorry for unformatted post, I don't see any formatting tags.

      Reply Quote 1
        1 Reply Last reply
      • sgunhouse
        sgunhouse Moderator Volunteer last edited by

        The system uses "markdown", though I haven't got it all down yet. Sorry, can't help with code.

        Reply Quote 0
          1 Reply Last reply
        • christoph142
          christoph142 last edited by

          @sgunhouse: He's talking about extension code not the forum. No markdown there.

          Reply Quote 0
            1 Reply Last reply
          • First post
            Last post

          Computer browsers

          • Opera for Windows
          • Opera for Mac
          • Opera for Linux
          • Opera beta version
          • Opera USB

          Mobile browsers

          • Opera for Android
          • Opera Mini
          • Opera Touch
          • Opera for basic phones

          • Add-ons
          • Opera account
          • Wallpapers
          • Opera Ads

          • Help & support
          • Opera blogs
          • Opera forums
          • Dev.Opera

          • Security
          • Privacy
          • Cookies Policy
          • EULA
          • Terms of Service

          • About Opera
          • Press info
          • Jobs
          • Investors
          • Become a partner
          • Contact us

          Follow Opera

          • Opera - Facebook
          • Opera - Twitter
          • Opera - YouTube
          • Opera - LinkedIn
          • Opera - Instagram

          © Opera Software 1995-2025