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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:15:27+00:00 2026-06-14T04:15:27+00:00

I have been asked to pass some html which is being sent from my

  • 0

I have been asked to pass some html which is being sent from my server to my Firefox add-on through a function called parseHTML by a Mozilla add-on reviewer. The method in question is documented in this XUL school tutorial.

In my content script however, typeof parseHTML == "undefined". I believe this is because my add-on is built using the add-on SDK, not XUL.

It is correct that add-ons built with the SDK do not have access to this method? Is there an equivalent method in the SDK?

  • 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-14T04:15:28+00:00Added an answer on June 14, 2026 at 4:15 am

    Of course this function is undefined – it isn’t some globally defined helper but rather something you have to define in your code (as shown in the code example). It uses the nsIParserUtils interface that you would need to have access to. In an SDK-based extension you would use chrome authority for that:

    var {Cc, Ci} = require("chrome");
    var parser = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils);
    var sanitized = parser.sanitize(html, parser.SanitizerAllowStyle);
    

    If you are in a content script then you cannot use that of course – you would need to send the HTML code to the add-on, sanitize it there and send it back to the content script. While this is an option, you might want to consider other possibilities like not using innerHTML in the first place (if all you need is setting some text on an element then textContent is a safe alternative).

    Side-note: While XUL Tutorial is rather old, this particular page has only been imported into MDN a year ago – and updated regularly since that according to history. So it is current, just not meant explicitly for the Add-on SDK (like most MDN articles actually).

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

Sidebar

Related Questions

I have been asked to create some functionality in which marketing team send users
I have some reports with drilldown, and I have now been asked to add
I have been asked to document some code. Some javascript functions pass parameters like
I have been asked to write a script that pulls the latest code from
I have been asked to implement some email address validation on a web app
I have been asked in an interview how do you pass an array to
I have been asked to improve the memory efficiency of an application that is
We have been asked to increase the performance of a clients site search. Before
I have been asked by my supervisor to develop a web application using either
I have been asked to get details of every user that logs into our

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.