0

I am building a Chrome extension that works with a conversion optimization tool (visual website optimizer or VWO to be precise). On websites that use VWO the tool shows information like running experiments, the data needed is retrieved from the DOM.

Now I want to implement a feature that will list goals fired on a page. A goal is a user defined event such as page view, clicks on elements etc. When a goal is fired VWO sends a c.gif call to their server, this call contains the information I need.

I can see the c.gif call in the Chrome network console so I assume my extension should somehow be able to do the same. But how this is achieved I can't figure out. And help here would be greatly appreciated :)

I found some help here: Chrome extension that runs code when ajax requests happen and here: https://developer.chrome.com/extensions/webRequest but I couldn't get my code to register the Ajax event (or any Ajax event).

My extension is designed like this: A default pop-up.html with a pop-up.js that on load fetches the background script. The background script asks the content script for the DOM data. When the data is retrieved it is send back via the background to the popup.js

I hope someone can help me with this. If possible I would prefer not to use jQuery (or another library) unless they make matters much easier. (that's why I tagged jQuery)

Community
  • 1
  • 1
Daan
  • 1
  • 2
  • 1
    [Spoof XMLHttpRequest](https://stackoverflow.com/a/29293383) inside a [script element](https://stackoverflow.com/questions/9515704/insert-code-into-the-page-context-using-a-content-script) in order to access the page context. – wOxxOm Mar 03 '17 at 17:17
  • 2nd duplicate: [Insert code into the page context using a content script](http://stackoverflow.com/q/9515704) – Makyen Mar 03 '17 at 18:51

0 Answers0