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

  • SEARCH
  • Home
  • 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 7412383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:31:52+00:00 2026-05-29T06:31:52+00:00

My addon opens a popup panel ( popup.html ). When the user changes the

  • 0

My addon opens a popup panel (popup.html).

When the user changes the current tab to different tab, the popup panel is hidden until the user clicks again on the addon icon. (Meanwhile the addon still “lives” in the background).

When the popup panel is opened the second time I need it to RELOAD its contentURL (popup.html) but I did find the way to do it.

That might look simple but I have only little experience with the Add-on SDK.

Any help will be appreciated.

This is my code:

exports.main = function() {
  data = require('self').data;
  var tabs = require("tabs");

  var popupPanel = require("panel").Panel({
    width:550,
    height:400,
    contentURL: data.url("popup.html"),  
    contentScriptFile: [data.url("popup.js")],       
    contentScript: " "+
      "self.port.on('curTabMsg', function(curTabMsg) {" +
        "main(curTabMsg['curTab']);" +
      "});"
  }); 


  require('widget').Widget({
    panel: popupPanel,
    onClick: function() {    
      popupPanel.port.emit("curTabMsg",{'curTab': tabs.activeTab.url}); 
    }
  });
};
  • 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-29T06:31:53+00:00Added an answer on May 29, 2026 at 6:31 am

    Reload the html of the iframe did not my problem after all. (I needed to reload my contentScript as well)

    So What I did finally was to create a new panel each time the widget is clicked.

    I added a new file to the lib called myPanel.js

    function getPanel(contentURL,contentScriptFile,contentScript){
        var popupPanel = require("panel").Panel({
              width:550,
              height:400,
              contentURL: contentURL,  
              contentScriptFile: contentScriptFile,       
              contentScript: contentScript
             }); 
        return popupPanel;   
    }
    
    exports.getPanel = getPanel;
    

    And in my main.js :

    exports.main = function() {
        data = require('self').data;
        var myPanel=require("myPanel");
        var tabs = require("tabs");
    
        let myWidget = require('widget').Widget({
          id: "SomeId",
          label: "Some lable",
          contentURL: data.url("some.png"),
          onClick: function() { 
              var panel = myPanel.getPanel(data.url("popup.html"),[data.url("popup.js")],
                          "self.port.on('curTabMsg', function(curTabMsg) {" +
                                "main(curTabMsg['curTab']);" +
                            "});");        
              panel.show();
              panel.port.emit("curTabMsg",{'curTab': tabs.activeTab.url}); 
          }
        });
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this javascript code in firefox addon: window.open(link); It opens a link in
I have an addon that open a html page when you click a button
I am writing a Firefox addon and it opens a page in the addon
in my Outlook 2007 addin this code opens modal dialog box about user details
I have updated my android sdk with samsung galax tab addon , it installed
In the firefox addon update dialog, a message tip will be displayed which can
Is there any addon by which I can disable all catch blocks temporarily. I'm
Debugging a Firefox addon is a slow process: (1) edit source code in a
Is there any firefox addon which can display my asp.net page viewstate size.... Any
I wanna develop an addon (basically a hack) for IPhone native phone app. My

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.