I want to write an extension for Chrome to watch my XHR calls and I found that i have to use webRequest for this.
I want to get the response-body of the request but i never can find how to do this. Is this possible?
// chrome.browserAction.onClicked.addListener(function (tab) {
var callback = function(details) {
var url = details.url;
console.log(details);
};
var filter = {
urls: ["*://safan.dev/*"]
};
var ops = ["requestBody"];
chrome.webRequest.onBeforeRequest.addListener(
callback, filter, ops
);
// });
And manifest:
{
"manifest_version": 2,
"name": "Forge of Empires",
"description": "FOE",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"webRequest",
"<all_urls>"
],
"background": {
"scripts": ["logic.js"]
}
}
I want to write an extension for Chrome to watch my XHR calls and I found that i have to use webRequest for this.
I want to get the response-body of the request but i never can find how to do this. Is this possible?
// chrome.browserAction.onClicked.addListener(function (tab) {
var callback = function(details) {
var url = details.url;
console.log(details);
};
var filter = {
urls: ["*://safan.dev/*"]
};
var ops = ["requestBody"];
chrome.webRequest.onBeforeRequest.addListener(
callback, filter, ops
);
// });
And manifest:
{
"manifest_version": 2,
"name": "Forge of Empires",
"description": "FOE",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"webRequest",
"<all_urls>"
],
"background": {
"scripts": ["logic.js"]
}
}
Share
Improve this question
edited May 10, 2017 at 17:26
james.garriss
13.4k7 gold badges86 silver badges100 bronze badges
asked Jul 6, 2016 at 10:08
Wim te GroenWim te Groen
1752 silver badges13 bronze badges
1 Answer
Reset to default 5I want to get the response-body of the request but i never can find how to do this. Is this possible?
Not at the moment. There is a long-standing feature request.
Note that you can do it using devtoolswork
API (requires Dev Tools to be open) or Debugger API (requires Dev Tools to be closed, low-level).
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745518085a4631119.html
评论列表(0条)