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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:35:44+00:00 2026-05-26T23:35:44+00:00

When my extension gets access to an INPUT (type text ) or TEXTAREA element

  • 0

When my extension gets access to an INPUT (type "text") or TEXTAREA element of the currently displayed webpage in Firefox, I can use QueryInterface to cast it to a JS object of type nsIDOMNSEditableElement and then I can access the associated nsIEditor using .editor.

However, Firefox supports other elements to be editable as well, e.g. any element (and its children) is editable if it has the attribute contentEditable set to true. Further a whole document can be editable if it has designMode set to on. In either case, the editable elements are not instances of nsIDOMNSEditableElement; QueryInterface for nsIDOMNSEditableElement fails.

Since those editable elements can also have spell checking enabled (if they have the attribute spellcheck set to true), I assume that there is an instance nsIEditor associated with them.

How would I get a reference to it?

  • 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-26T23:35:44+00:00Added an answer on May 26, 2026 at 11:35 pm

    For editable frames (via designMode property) you can retrieve it like this:

    var session = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                        .getInterface(Components.interfaces.nsIWebNavigation)
                        .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                        .getInterface(Components.interfaces.nsIEditingSession);
    if (session.windowIsEditable(window)
      editor = session.getEditorForWindow(window);
    

    As to contentEditable – you seem to be out of luck. I couldn’t find a way to access the editor from JavaScript: nsGenericHTMLElement class has a GetEditor method but it is only accessible through nsIDOMNSEditableElement interface that only few elements implement. nsIAccessibleEditableText interface has an associatedEditor property but it is marked as [noscript] for some reason. contentEditable is a relatively new feature in Gecko and it looks like somebody forgot to make the editor accessible for JavaScript – probably worth filing a bug at https://bugzilla.mozilla.org/.

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

Sidebar

Related Questions

I currently use this handy conversion extension method to do conversions between types: public
I am writing a firefox extension that intercepts the XMLHttpRequest before the page gets
Imagine that I introduced an extension method on string type called Shorten() which gets
Extension method is a really helpful feature that you can add a lot of
I typically use extension methods very sparingly. When I do feel compelled to write
Notice how Firebug can access the DOM of cross domain iframes and even allow
I am developing a Google Chrome extension, and need to use the chrome.experimental.webRequest API.
Looking for a Linux application (or Firefox extension) that will allow me to scrape
I have a Firefox extension that pops up a log-in form (it's a c++
I have written a Firefox extension that catches when a particular URL is entered

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.