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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:13:51+00:00 2026-05-21T22:13:51+00:00

Hey there! I submitted my add on to the Mozilla add ons site and

  • 0

Hey there!
I submitted my add on to the Mozilla add ons site and the editor got back and told me only one problem:

Your preliminary review request has
been approved.

Here are a few things that you need to
fix in your next version, specially if
you want to apply for full approval:

1) In order to prevent conflicts with
other add-ons that may be installed by
users, you need to wrap your “loose”
variables and functions within a
JavaScript object. You can see
examples on how to do this at
https://developer.mozilla.org/en/XUL_School/JavaScript_Object_Management.

So I went there and started reading up… but it’s a lot of stuff that feels like gibberish to me and I confused myself (not hard to do at all!)

Using the first example on that page, can you kindly tell me how to modify my xul file?

Presently it looks like this:

  <?xml version="1.0"?>
  <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

  <overlay id="quickfilterOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://quickfilter/content/quickfilter.js">
  </script>
  </overlay>

Thanks in advance!
R

EDIT:
Have uploaded the entire add on here: http://www.mediafire.com/?fff6bjzjy6n39nx

  • 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-21T22:13:52+00:00Added an answer on May 21, 2026 at 10:13 pm

    It is advisable to encapsulate your code in a namespace to avoid name collisions. Here’s what I always do in my addons:

    if(!org) var org={};
    if(!org.janek) org.janek={};
    
    org.janek.Addon = function() {
    
      var pub = {};
      var self = this;
    
      pub.init = function() {
         //
         // Initialize addon, setup listeners, ...
         //
      }
    
      ...
    
      self.thisIsAPrivateMethod = function(arg) {
        // method that's only visible inside org.janek.Addon
      }
    
      return pub;
    }();
    
    
    // Init addin after window loaded
    window.addEventListener("load",
                            org.janek.Addon.init,
                            false);
    

    First, I create my own namespace org.janek, making sure it doesn’t already exist. Then I add the object Addon which will contain the code for my addon.

    Please note the “pub” and “self” objects. Every method that should be callable from other objects is added to the pub object. Private methods are added to self.

    To be more specific, I would change the quickfilter_extension to the following code (I included the global prefManager object as an example):

    var quickfilter_extension = function() {
        var pub = {};
    
        // interface for preferences
        pub.prefManager = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
    
        pub.init = function() {
            //Initiating the progressListerner
            gBrowser.addProgressListener(quickfilter_urlBarListener, Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
            //Load the block list xml form server
            quickfilter_quickfilter.request_xml();
        },
    
        pub.uninit =  function() {
            // Remove the progressListerner
            gBrowser.removeProgressListener(quickfilter_urlBarListener);
        }
    
        return pub;
    }();
    

    Code that uses the prefManager object now needs to go through the quickfilter_extension object:

    redirectToAnotherUrl:function()
    {
        [ ... omitted ...]
        qucikFilterRedirectCount = quickfilter_extension.prefManager.getCharPref("extensions.quickfilter_redirect_count");
    
        [ ... omitted ...]
    }
    

    The blog for Yahoo’s javascript library YUI has a nice article about the pattern.

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

Sidebar

Related Questions

Hey there I got a problem with my code, I compared three ways of
Hey there, new to AJAX, JS.. Im trying to add to a Javascript/Ajax search
hey there i am having problem i have List<List<memoryCard>> that i want to show
Hey there, I have a small problem with compiling and linking with the command
Hey there, In class we're using the Scite editor with gcc and its a
Hey there. I would really appreciate your help in creating a query that would
Hey there, I'm trying to make a site which have following: News, Products, About
Hey there! So I got Facebook to work with Flash as I wanted it
Hey there, I've got a project at work that may require me to load/unload
Hey there guys, I'm learning processing.js, and I've come across a mathematical problem, which

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.