Asked  7 Months ago    Answers:  5   Viewed   29 times

In Firefox, I use Firebug which allows me to view every http request my ajax calls are making. I've switched over my development to Chrome and am liking it so far. My only complaint, however, is that the developer tools don't seem to allow you to view each ajax request. I've had it happen once where the Resources panel showed multiple requests to the same resource, but it's only done it once and never again.

Is there a way to reliably see every http request that a page is making through javascript from within Chrome?

[Edit:11/30/09 11:55]

Currently, to get around this, I'm running Fiddler next to Chrome to view my requests, but if there's a way to do it from within the browser, I'd prefer that.

 Answers

25

I know this is an old thread but I thought I would chime in.

Chrome currently has a solution built in.

  1. Use CTRL+SHIFT+I (or navigate to Current Page Control > Developer > Developer Tools. In the newer versions of Chrome, click the Wrench icon > Tools > Developer Tools.) to enable the Developer Tools.
  2. From within the developer tools click on the Network button. If it isn't already, enable it for the session or always.
  3. Click the "XHR" sub-button.
  4. Initiate an AJAX call.
  5. You will see items begin to show up in the left column under "Resources".
  6. Click the resource and there are 2 tabs showing the headers and return content.
Tuesday, June 1, 2021
 
francadaval
answered 7 Months ago
100

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);
Friday, August 13, 2021
 
tiny
answered 4 Months ago
53

This issue is not related to web framework or server. Issue affects Chrome browser version 31.0.1650.57.

Now issue is fixed and will be delivered with next stable channel update. Fix diff

If you need fix urgently, you can update to dev channel version. Instructions

See this issue for more details.

Saturday, August 14, 2021
 
mgraph
answered 4 Months ago
34

The chrome.storage api is asynchronous, so the approach that you are taking here will not work. The basic run-through of what is happening with the code you have is:

  1. Before the webrequest, check if the url is http://myapp.com/theurl
  2. If it is, then make an asynchronous call to chrome.storage.local.get
  3. The code inside your chrome.storage.local.get call (ie. the return statement) is not executed immediately and will be run at some later time
  4. The rest of your code continues to run and nothing is returned from your webRequest listener

There are a couple of ways that you can make this work. The easiest would be to store the values of the local storage inside some variable when your extension is loaded (call it, say, storage_cache). Then from the webRequest listener you could say return { redirectUrl: storage_cache.savedUrl };

If your storage will change frequently then there are better approaches than this one...but the key thing to remember for whatever implementation your choose is to not to mix up synchronous and asynchronous events.

Thursday, August 26, 2021
 
Usman Khan
answered 4 Months ago
48

I have v19 and i do see the correct value. Are you sure you don't have any emulator (user agent emulator) or something like this...

chrome 19

Browser Capabilities
Type = Chrome19
Name = Chrome
Version = 19.0
Major Version = 19
Minor Version = 0
Platform = WinNT
Is Beta = False
Is Crawler = False
Is AOL = False
Is Win16 = False
Is Win32 = True
Supports Frames = True
Supports Tables = True
Supports Cookies = True
Supports VBScript = False
Supports JavaScript = 3.0
Supports Java Applets = True
Supports ActiveX Controls = False
Supports JavaScript Version = 1.7

ie 8

Browser Capabilities
Type = IE7
Name = IE
Version = 7.0
Major Version = 7
Minor Version = 0
Platform = WinNT
Is Beta = False
Is Crawler = False
Is AOL = False
Is Win16 = False
Is Win32 = True
Supports Frames = True
Supports Tables = True
Supports Cookies = True
Supports VBScript = True
Supports JavaScript = 3.0
Supports Java Applets = True
Supports ActiveX Controls = True
Supports JavaScript Version = 1.5

and this is the code for this output:

   string s = "Browser Capabilitiesn"
            + "Type = " + browser.Type + "n"
            + "Name = " + browser.Browser + "n"
            + "Version = " + browser.Version + "n"
            + "Major Version = " + browser.MajorVersion + "n"
            + "Minor Version = " + browser.MinorVersion + "n"
            + "Platform = " + browser.Platform + "n"
            + "Is Beta = " + browser.Beta + "n"
            + "Is Crawler = " + browser.Crawler + "n"
            + "Is AOL = " + browser.AOL + "n"
            + "Is Win16 = " + browser.Win16 + "n"
            + "Is Win32 = " + browser.Win32 + "n"
            + "Supports Frames = " + browser.Frames + "n"
            + "Supports Tables = " + browser.Tables + "n"
            + "Supports Cookies = " + browser.Cookies + "n"
            + "Supports VBScript = " + browser.VBScript + "n"
            + "Supports JavaScript = " +
                browser.EcmaScriptVersion.ToString() + "n"
            + "Supports Java Applets = " + browser.JavaApplets + "n"
            + "Supports ActiveX Controls = " + browser.ActiveXControls
                  + "n"
            + "Supports JavaScript Version = " +
                browser["JavaScriptVersion"] + "n";
Wednesday, December 1, 2021
 
Jörn Hees
answered 3 Days ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :  
Share