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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:10:30+00:00 2026-06-06T05:10:30+00:00

I have a chrome extension which makes some changes on the site (editing comments).

  • 0

I have a chrome extension which makes some changes on the site (editing comments).

After recent changes on the site (site is not mine) – the comment block loads using ajax (before it was simple post request with the whole page reload).

Now if I load the page first time – content script works, but when I go to next page, say page #2 – the comments are added using ajax and the extension script is not run anymore. So the comments are not changed the way I want.

Is there any simple way to listen to page changes DOM and apply extension script again?

in manifest file I have:

{
  "name": "Name",
  "version": "1.0",
  "description": "Description",
  "icons": {"16":"16.png",
            "48":"48.png",
            "32":"32.png",
            "128":"128.png"},
  "browser_action": {
    "default_title": "Default title",
    "default_icon": "48.png",
    "popup": "popup.html"
  },
  "permissions": [
    "tabs",
    "http://www.site.com/*",
    "notifications",
    "unlimitedStorage"
  ],

  "options_page": "options.html",
  "background_page": "background.html",

  "content_scripts": [
                {
                    "matches": ["http://www.site.com/*","https://www.site.com/*"],
                    "js": ["jquery-1.7.1.min.js","content.js"],
                    "run_at": "document_end"
                }]
}
  • 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-06T05:10:32+00:00Added an answer on June 6, 2026 at 5:10 am

    You could add a listener on the event called DOMSubtreeModified. Bind a function to it, and it gets called whenever there’s a change.

    In jQuery:

    $('#ContentContainer').bind('DOMSubtreeModified',modifyComments);
    

    UPDATE:

    In case the event is firing multiple times, delete the event binding during the first time, and after a certain timeout, you can call modifyComments and rebind the event.

    function DOMModificationHandler(){
        $(this).unbind('DOMSubtreeModified.event1');
        setTimeout(function(){
            modifyComments();
            $('#ContentContainer').bind('DOMSubtreeModified.event1',DOMModificationHandler);
        },1000);
    }
    
    //after document-load
    $('#ContentContainer').bind('DOMSubtreeModified.event1',DOMModificationHandler);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Chrome extension which is injecting some code into a web page
I have a chrome extension which have a server-side javascript and I need this
At the moment I am developing a Google Chrome Extension in which I have
I'm working on a chrome extension, which use asynchronous functions, and I have a
I have a chrome extension which monitors the browser in a special way, sending
I have a small chrome extension which I want to use to change text.
I have a chrome extension in which I have two text boxes, one for
I have a windows application which installs a Chrome extension via the windows registry.
I'm building a Chrome extension, which uses multiple APIs. Currently I have it set
I have a Chrome extension that has some links in it. Currently when clicked

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.