Integration of onResourceRequested (Issue #403) #438
Conversation
+ Attention: Capybara::Poltergeist::TimeoutError is thrown if you block a resource for now
* blocked request are stored now * a blocked iframe won't result in a timeout now
Conflicts: lib/capybara/poltergeist/browser.rb spec/integration/driver_spec.rb
👍 |
Sorry, my last commit ( a23cfab ) obviously broke it somehow. 😟 |
Fixed |
@antifarben and @alexanderadam can we squash this into less than 6 commits and rebase it against upstream? |
Sure. I also created a branch with a single commit against latest master which even could look cleaner. PS: Wrong account. Sorry for the confusion: @alexanderadam & @antifarben are both mine but for different purposes. |
@antifarben @alexanderadam Yeah if you can squash this into a single commit and rebase it I'll get it in. |
Just to be sure: the other pr could be found here |
@yaauie I'd be glad to hear from you about it... |
closed in favor of PR 486 |
This is the result from #403 and "reactivates" the onResourceRequested functionality from phantomjs.
In the spec ( https://github.com/alexanderadam/poltergeist/blob/c27d9b279fdb579bf3c5b95b24ed6a9e31a431b4/spec/integration/driver_spec.rb#L710 ) you can see how you can control the accepting/blocking of a request.
The request will just be blocked if there is a JavaScript snippet given and it returns a falsy value.