Chrome should use webRequest API rather than x-domain AJAX #44

Open
marcelduran opened this Issue Jul 10, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@marcelduran
Owner

marcelduran commented Jul 10, 2012

Chrome extensions now officially support webRequest API. It should be used in replacement of x-domain AJAX. The API is pretty simple:

chrome.webRequest.onSendHeaders.addListener(function (details) {
    console.log('headers sent', details);
}, {urls: ['*://*/*']}, ['requestHeaders']);

chrome.webRequest.onHeadersReceived.addListener(function (details) {
    console.log('headers received', details);
}, {urls: ['*://*/*']}, ['responseHeaders']);

chrome.webRequest.onCompleted.addListener(function (details) {
    console.log('completed', details);
}, {urls: ['*://*/*']}, ['responseHeaders']);

However, it doesn't seem to expose the content retrieved, therefore x-domain ajax should still be used for this particular task on non-binary content.

@ghost ghost assigned marcelduran Jul 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment