lib/puppeteer/request.rb in puppeteer-ruby-0.0.16 vs lib/puppeteer/request.rb in puppeteer-ruby-0.0.17
- old
+ new
@@ -104,21 +104,19 @@
# proceed request on request interception.
#
# Example:
#
- # ````
- # page.on 'request' do |req|
- # # Override headers
- # headers = req.headers.merge(
- # foo: 'bar', # set "foo" header
- # origin: nil, # remove "origin" header
- # )
- # req.continue(headers: headers)
- # end
- # ```
- #`
+ # page.on 'request' do |req|
+ # # Override headers
+ # headers = req.headers.merge(
+ # foo: 'bar', # set "foo" header
+ # origin: nil, # remove "origin" header
+ # )
+ # req.continue(headers: headers)
+ # end
+ #
# @param error_code [String|Symbol]
def continue(url: nil, method: nil, post_data: nil, headers: nil)
# Request interception is not supported for data: urls.
return if @url.start_with?('data:')
@@ -150,19 +148,17 @@
# Mocking response.
#
# Example:
#
- # ```
- # page.on 'request' do |req|
- # req.respond(
- # status: 404,
- # content_type: 'text/plain',
- # body: 'Not Found!'
- # )
- # end
- # ````
+ # page.on 'request' do |req|
+ # req.respond(
+ # status: 404,
+ # content_type: 'text/plain',
+ # body: 'Not Found!'
+ # )
+ # end
#
# @param status [Integer]
# @param headers [Hash<String, String>]
# @param content_type [String]
# @param body [String]
@@ -209,19 +205,17 @@
# abort request on request interception.
#
# Example:
#
- # ````
- # page.on 'request' do |req|
- # if req.url.include?("porn")
- # req.abort
- # else
- # req.continue
+ # page.on 'request' do |req|
+ # if req.url.include?("porn")
+ # req.abort
+ # else
+ # req.continue
+ # end
# end
- # end
- # ```
- #`
+ #
# @param error_code [String|Symbol]
def abort(error_code: :failed)
# Request interception is not supported for data: urls.
return if @url.start_with?('data:')