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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:20:04+00:00 2026-05-26T07:20:04+00:00

I’ve been working on a embedded widget(html,css,js) that receives some text every x seconds

  • 0

I’ve been working on a embedded widget(html,css,js) that receives some text every x seconds and interpret that text depending on what 3rd party add-ons are being installed. It is something similar with firefox add-ons system only much simplified.
Let me give you an example of what I’m trying to achieve.
I provide an embedded code for a widget, so that people can put it on their sites, similar with twitter updates widget. I also provide a small api(in javascript) so that people can create some extensions(add-ons). For example if in the text that is loaded every x seconds appears a youtube link , instead of showing the link, the addon can replace it with the embedded video. Another example are smileys: replace 🙂 for example with an image. The list can go on, but I think you got the picture.

The problem is that when 2 or more add-ons try to replace the same content.

For example let say the widget loads the following text: http://www.youtube.com/watch?v=video_id and one add-on tries to replace the text with the video and the other add-on tries to replace it with the related image thumb.

How can I solve the interference between 2 add-ons. I’m also interested how firefox deals with this situation on their add-ons system. I’ve read some of their documentation about XUL overlays but I didn’t find anything about this situation. On their documentation page: https://developer.mozilla.org/en/XUL_Overlays they said the XUL overlays can be used for:

  • adding UI for additional components, as described in the example
  • above overriding small pieces of a XUL file without having to
  • resupply the whole UI reusing particular pieces of the UI

I’m interested more in the last 2, in the situation explained above, but without any luck. I’ve also searched on google, but didn’t find anything.

So far the only solution I can think of is to make a mechanism that can find if 2 or more add-ons overwrite the same UI and notify the user(the one that wants to install the widget on his site) to disable one of the add-ons. If this is the only solution, I’m also interested in your ideas on how to achieve this.

NOTE: The add-ons are not necessary done by the person who put the widget on his site. It will will a system similar to firefox add-ons where the user choose what addons to install and then just copy -paste the code into his site.

  • 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-26T07:20:05+00:00Added an answer on May 26, 2026 at 7:20 am

    I’m not sure if this is what you’re looking for, but I can think of the solution like that:

    1) Create some kind of identifiers for each type of contents that are being replaced. E.g.

    • YOUTUBE_LINK
    • SOME_SMILEY
    • SOME_OTHER_SMILEY

    2) When the application starts, add-ons register to each type of replacement. So there is globally available set/array/whatever collection type, having registered add-ons to handling different types of texts.
    More specifically, there is a map (associative array), that maps, in Java notation:

    InputText => Set<AddOn>

    For instance, basing on strings and arrays (this is after adding it dynamically by each addon; order doesn’t matter)

    listeners["YOUTUBE_LINK"] = ["addon1", "addon7"];
    listeners["SOME_SMILEY"] = ["addon2", "addon7", "addon9"]
    

    3) The addons either have IDs that mean their “priority” of handling the inputs, or it is somehow configurable (either per-application globally, or per-addon, the order in which they should run over different kinds of contents).

    E.g.
    Something in the configuration of the app:

    order["YOUTUBE_LINK"] = ["addon7", "addon3", "addon5", "addon1"]
    

    which means, if addon7 is installed, then use it to process youtube links; if no, use addon3; if no addon3, use addon5 and so on…

    The problem is that if you don’t know about all possible addons being developed, you can’t use it like that.
    What you can do is, wait for all addons to load, and then display information to the user:
    “addon1” and “addon7” want to process Youtube links, which one do you want to do this? (click something, and then store the setting, or make user write it down in the script).

    The foolish way (but maybe not so much, if the behaviors of addons are strictly the same), that each addon can have some ID inside of it, and depending on which one has the highest ID, it performs the action.

    About Firefox, if there are two competing addons trying to do similar jobs, it often ends up in incompatibility… Depending of course if the efforts of the addons can or can not be combined. But basically, you have to assure some way of the order of the things, otherwise it can end up random, which is definitely not the good way.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.