Expose Response Headers Chrome 插件, crx 扩展下载

 收录于4年前 阅读数 51

扩展ID: omlflgllokdkamhdgiaalffaeopelagg

Expose the page response headers to Navigator object to make them available from Selenium and other web driversThis is a technical extension to be used with web drivers like Selenium. It adds the so-needed functionality like providing response headers and response status code for requested urls. The available items go to Navigator object, under following properties:

navigator.requestHeaders = <array>;
navigator.requestUrl = <string>;
navigator.requestMethod = <string>;
navigator.responseHeaders = <array>;
navigator.responseStatusCode = <string>;
navigator.responseStatusLine = <string>;
navigator.responseUrl = <string>;
navigator.responseMethod = <string>;

To get those values, you typically need to get them by running a javascript in a page context, and returning the result. In Selenium, it would look something like this:

var builder = new selenium.Builder().withCapabilities(selenium.Capabilities.chrome());
var options = new selenium_chrome.Options();
options.addExtensions(__dirname + "/response-headers.crx");
builder.setChromeOptions(options);
var page = builder.build();
page.then(function() {
   // load your url here
}, function(err) {
   // error creating browser
});

/// then somewhere after loading the url, you would do
page.executeScript(function() {
  return {
    statusCode: navigator.responseStatusCode
  }
}).then(function(obj) {
  // now you have obj.statusCode
});

Gist example: https://gist.github.com/javascriptlove/4a00c4931c4c83287f4efd6c23fd02ed
名称 Expose Response Headers
插件标识 omlflgllokdkamhdgiaalffaeopelagg
平台 Chrome
评分 0
评分人数 0
插件主页

作者 Alexander Kuzmenok
版本号 1.0.1
大小 19.27 KB
官网下载次数 11
分类 查看更多 web开发 分类下的扩展插件
下载地址
更新时间 2017-03-02 00:00:00
举报
回复

大家在找这些插件