schickling/chromeless

Listening to instance events

Open

#257 创建于 2017年8月22日

在 GitHub 查看
 (1 评论) (3 反应) (0 负责人)TypeScript (606 fork)batch import
APIfeaturehelp wanted

仓库指标

Star
 (13,240 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

With nightmare.js it is possible to add an event listener, for example:

function onResponseDetails(event, status, newURL, originalURL, httpResponseCode, requestMethod, referrer, headers, resourceType) {
    if (httpResponseCode === 200) {
        if (resourceType === 'stylesheet') { stylesheets.push(newURL); }
        if (resourceType === 'image') { images.push(newURL);}
    }
  }

nightmare.on('did-get-response-details', onResponseDetails)

I think it's actually a electron feature https://electron.atom.io/docs/api/web-contents/#instance-events.

Anyway, I humbly request similar functionality to be added to chromeless. (Perhaps there is a way already?)

Thank you for your time!

贡献者指南