Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:30:22+00:00 2026-05-27T02:30:22+00:00

Within a Chrome extension, how can I inject items into the context menus of

  • 0

Within a Chrome extension, how can I inject items into the context menus of 3rd party flash objects?

Is it possible to simply inject items using JavaScript?

Is it possible to wrap the players in a container .swf that adds our context menu item along with the items included by the original swf?

Thanks so much for your ideas and inspiration!

Edit: To be clear, what I’d like to do with my extension is add a context menu item to any 3rd party Flash program. So for instance, if a user visits YouTube, I’d like to add my own menu item along with YouTube’s custom items.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:30:23+00:00Added an answer on May 27, 2026 at 2:30 am

    The easiest solution is to do exactly what you and @felipemaia suggested – make use of a loader SWF that adds (or modifies) the context menu of its loaded SWF.

    The original (loaded) SWF:

    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;
    
    var customContextMenu:ContextMenu = new ContextMenu();
    // Comment in if you want to hide the default context menu items.
    // customContextMenu.hideBuiltInItems();
    var sampleItem:ContextMenuItem = new ContextMenuItem('Cheerio!');
    customContextMenu.customItems.push(sampleItem, new ContextMenuItem('What it do?'));
    this.contextMenu = customContextMenu;
    

    And the loader SWF:

    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.Event;
    
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, modify_context_menu);
    loader.load(new URLRequest('LoadedSWF.swf'));
    
    function modify_context_menu(event:Event):void
    {
        var loadedSWF:Sprite = (event.target as LoaderInfo).content as Sprite;  
        var loadedContextMenu:ContextMenu = loadedSWF.contextMenu;  
        loadedContextMenu.customItems.push(new ContextMenuItem('Parent Menu Item'), new ContextMenuItem('Parent what it be?'));
    
        this.contextMenu = loadedContextMenu;
    }
    

    Note that if you need finer grain control you can also modify the context menu on individual InteractiveObject subclasses:

    var sprite:Sprite = new Sprite();
    var spriteContextMenu:ContextMenu = new ContextMenu();
    spriteContextMenu.customItems.push(new ContextMenuItem('Instance specific menu item!'));
    sprite.contextMenu = spriteContextMenu;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to access Google Chrome's cache from within an extension? I'd like
I'm trying my hands at a simple Chrome Extension, but am running into a
I have a NPAPI plugin, incorporated into Chrome extension, and defined in manifest file
Hello Chrome Extension geeks, Is there any way that we can read a the
I am building a chrome extension which will only be available for people within
I'm using the following script within a Chrome extension I made. It replaces old
My default browser is Chrome. When I run my web applications within VS 2008
A Chrome extension I built a few months ago has been working fine until
I have this Chrome extension that modifies the header of requests before sending them.
What is the best way to determine a page's referrer within the context of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.