def base64_canvas
      return self.base64 if base64_capable?
      output = nil

      return self.base64 if one_shot? || bug_shot?

      @browser.execute_script html2canvas_payload
      @browser.execute_script h2c_activator

      @browser.wait_until(timeout: MAXIMUM_SCREENSHOT_GENERATION_WAIT_TIME) {
        output = @browser.execute_script "return window.canvasImgContentDecoded;"
      }

      raise "Could not generate screenshot blob within #{MAXIMUM_SCREENSHOT_GENERATION_WAIT_TIME} seconds" unless output

      output.sub!(/^data\:image\/png\;base64,/, '')
    end
def base64_canvas
      return self.base64 if base64_capable?
      output = nil

      return self.base64 if one_shot? || bug_shot?

      @browser.execute_script html2canvas_payload
      @browser.execute_script h2c_activator

      @browser.wait_until(timeout: MAXIMUM_SCREENSHOT_GENERATION_WAIT_TIME) {
        output = @browser.execute_script "return window.canvasImgContentDecoded;"
      }

      raise "Could not generate screenshot blob within #{MAXIMUM_SCREENSHOT_GENERATION_WAIT_TIME} seconds" unless output

      output.sub!(/^data\:image\/png\;base64,/, '')
    end
Employs html2canvas to produce a Base64 encoded string
 of a full page screenshot.

 @example
   browser.screenshot.base64_canvas(browser)
   #=> '7HWJ43tZDscPleeUuPW6HhN3x+z7vU/lufmH0qNTtTum94IBWMT46evImci1vnFGT'

 @deprecated
   @param [Watir::Browser] browser

 @return [String]