0

I have chrome extension, with content script. Here's a part the manifest:

{
  "permissions": [
    "https://*/*","http://*/*"
  ],
  "content_scripts": [
    {
      "matches": [
        "https://*/*","http://*/*"
      ],
      "css": [
        "src/inject/inject.css"
      ],
      "js": [
        "js/jquery/jquery.min.js",
        "src/inject/inject.js"
      ]
    }    
  ]
}

As you can see inject script will process all kinds of pages. Some of them will be classic request loaded pages (stateful), some of them will be angular-like apps (stateless).

My question is how to detect and handle page html changes while page was already loaded? After each change i would like to add some addtion markup do the page DOM.

Do you have any clues how to do that?

IT Man
  • 933
  • 3
  • 12
  • 33
  • I've been trying to use injected jquery: `$("body").change()` but it has no effect when processing for example google result page. When i change search query no events are fired but body definitely changes. – IT Man Sep 15 '16 at 08:04
  • Thanks, ill check which of these presented techniques are suitable for my problem. I can comment back that here. – IT Man Sep 15 '16 at 09:34
  • I've added a more complete answer [Is there a JavaScript/jQuery DOM change listener?](https://stackoverflow.com/a/39508954) – wOxxOm Sep 15 '16 at 10:37
  • Hi, at the end i'm using: "_Extensions-specific: detect URL changes in a background / event page_". form this thread: http://stackoverflow.com/questions/2844565/is-there-a-javascript-jquery-dom-change-listener – IT Man Sep 28 '16 at 20:14

0 Answers0