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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:06:21+00:00 2026-05-20T18:06:21+00:00

I am facing a weird behavior and I need some help.. I encounter a

  • 0

I am facing a weird behavior and I need some help..

I encounter a situation when I try to recognize whether the content of the page was modified. I do it using

gBrowser.tabContainer.addEventListener("DOMSubtreeModified", function (e) { this.foo(e); }, false);

I also tried listening to document.DOMSubtreeModified and window.DOMSubtreeModified.

However, I sometimes get a situation in which the default\selected document is something that is irrelevant to me – perhaps some IFrame or a commercial built in or whatever, and bottom line my content is modified but when staring at the browser DOMSubtreeModified doesn’t fire since it listens to a document\whatever that was indeed not modified…

Can you please help my understnad where’s my problem? I need to create some event that recognizes any content modification (something like DOMSubtreeModified) that fires for every document, so that I could identify my relevant content and process it?

Thanks a lot,

Nili

  • 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-20T18:06:22+00:00Added an answer on May 20, 2026 at 6:06 pm

    You could explicitly listen for all DOM modification by adding a listener on the document object for each <iframe> element within the element you’re interested in:

    function listenForDomModified(node, listener) {
        node.addEventListener("DOMSubtreeModified", listener, false);
        var iframes = node.getElementsByTagName("iframe");
        for (var i = 0, len = iframes.length, doc; i < len; ++i) {
            // Catch and ignore errors caused by iframes from other domains
            try {
                doc = iframes[i].contentDocument || iframes[i].contentWindow.document;
                doc.addEventListener("DOMSubtreeModified", listener, false);
            } catch (ex) {}
        }
    }
    
    listenForDomModified(gBrowser.tabContainer);
    

    Note that the DOMSubtreeModified event doesn’t fire at all in Opera, so your code won’t work in that browser.

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

Sidebar

Related Questions

I'm facing some weird (at least for me) behavior on using the Common Item
We are facing a weird issue and need some brain storming here. I will
I am facing a really weird problem. I am using swfupload to upload multiple
I am facing is weird problem. I have an input field on my page
I am facing a weird problem with NSDate, when I try fetch a date
I am facing a weird situation, I am developing an asp.net website, and I
I am facing a weird issue and not sure whether it's jquery or combination
I'm facing a weird actions by codeiginter especially when it comes to using different
I am facing a weird problem with a text field on my page. This
I'm facing some weird css issue with django . My css works fine but

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.