class TiktokPassport::Marionette

Defined in:

tiktok_passport/marionette.cr
tiktok_passport/marionette/exceptions.cr
tiktok_passport/marionette/javascript.cr
tiktok_passport/marionette/pool.cr
tiktok_passport/marionette/session.cr
tiktok_passport/marionette/types/navigator_info.cr
tiktok_passport/marionette/user_agent_parser.cr

Constant Summary

CHROME_CAPABILITIES = Selenium::Chrome::Capabilities.new.tap do |conf| conf.chrome_options.args = ["--headless", "--disable-blink-features=AutomationControlled", "--disable-infobars", "--window-size=1920,1080", "--start-maximized"] conf.chrome_options.exclude_switches = ["enable-automation"] end

The remote browser desired capabilities.

SCRIPTS_TO_EXECUTE_ON_PAGE_LOAD = begin buffer = uninitialized ::StaticArray(String, 16) {% for key, index in ["/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/utils.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/chrome.app.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/chrome.csi.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/chrome.loadTimes.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/chrome.runtime.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/iframe.contentWindow.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/media.codecs.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/navigator.hardwareConcurrency.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/navigator.languages.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/navigator.permissions.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/navigator.plugins.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/navigator.vendor.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/navigator.webdriver.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/webgl.vendor.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/evasions/window.outerdimensions.js", "/srv/crystaldoc.info/github-lucasintel-tiktok-passport-v0.3.0/src/tiktok_passport/marionette/javascript/signer.js"] %} {% if env("MINIFY_JS") %} buffer[{{ index }}] = {{ (`uglifyjs --validate #{key}`).stringify }} {% else %} buffer[{{ index }}] = {{ read_file(key) }} {% end %} {% end %} buffer end

An array of javascript fucntions to execute on page load.

Constructors

Instance Method Summary

Constructor Detail

def self.new(remote_url : String) #

[View source]

Instance Method Detail

def evaluate(script, args = [] of String) #

Evaluates a script and wait for the response.


[View source]
def evaluate_cdp(command, params = {} of String => String) #

Evaluates a CDP (Selenium Chrome DevTools Protocol) command.


[View source]
def id : String #

Returns the current selenium session id.


[View source]
def navigate_to(url) #

Navigates to the given URL.


[View source]
def screenshot(path) #

Takes a screenshot of the current page.


[View source]
def stop #

Terminates the current selenium session.


[View source]
def user_agent : String #

Returns the navigator user agent.


[View source]
def user_agent=(desired_user_agent) #

Overrides the navigator user agent.


[View source]