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 8273559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:31:16+00:00 2026-06-08T07:31:16+00:00

I am trying to develop an addon for Firefox (using the latest version of

  • 0

I am trying to develop an addon for Firefox (using the latest version of JetPack) that sends some AJAX data on the click on a context item. However, unfortunately it seems I have hit some problem.

Please see the code below – I have tried to make it as simple as possible to understand.

// file main.js
var contextMenu = require("context-menu");
var data = require("self").data;

exports.main = function(options, callbacks) {
    var contextMenuItemContentScriptFiles = [data.url("content.js")];

    var menuItemSelection = contextMenu.Item({
        label: "This is a test",
        contentScriptFile: contextMenuItemContentScriptFiles,
        context: contextMenu.SelectionContext(),

                onMessage: function (testVar) {                    
                            alert(testVar);                    
                }                                
    });
};

// file content.js
self.on("click", function (node, data) {
        alert("before posting");
        self.postMessage("messagePosted");
        alert("after posting");
});

The code alerts “before posting” and “after posting” but it doesn’t alert “messagePosted” as I was expecting.

Can you please help me at finding the problem?

  • 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-06-08T07:31:18+00:00Added an answer on June 8, 2026 at 7:31 am

    Found the problem.

    I had to use console.log, not alert from the main script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to develop using MVVM: I have this Csla.PropertyStatus control that is created in
I am trying to develop a BlackBerry application that will show data from an
I'm trying to develop an Internet Explorer 7 addon using Browser Helper Objects (BHO).
Im trying to develop an application that should show a map using the Google
I'm trying to develop firefox addon with addon builder. I want to modify mail
I am trying to develop an NUnit addin that dynamically adds test methods to
Im trying to develop service that starts by bootup receiver if the wifi or
im trying to develop an app for a win CE mobile device that downloads
trying to develop web form using jquery. all i need is to have several
I am trying to develop a multi-screen app for the Google TV platform using

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.