Sha256: b3be1121c92bd4d26a5b7c193372d02b0ad59bfc43b90ca271fe312b2afc884e

Contents?: true

Size: 774 Bytes

Versions: 44

Compression:

Stored size: 774 Bytes

Contents

module Perus::Pinger
    class ChromeNavigate < ChromeCommand
        description 'Changes the URL of the top Chrome window to "url"'
        option :url

        def run
            result = false
            command = '{"id":1,"method":"Page.navigate","params":{"url":"' + options.url + '"}}'

            execute([command]) do |message|
                if message.include?('id') && message['id'] == 1
                    if message.include?('result')
                        result = true
                    elsif message.include?('error')
                        result = message['error'].to_s
                    else
                        result = message.to_s
                    end
                end
            end

            result
        end
    end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
perus-0.1.23 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.22 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.21 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.20 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.19 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.18 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.17 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.16 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.15 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.14 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.13 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.12 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.11 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.10 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.9 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.8 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.7 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.6 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.5 lib/perus/pinger/commands/chrome_navigate.rb
perus-0.1.4 lib/perus/pinger/commands/chrome_navigate.rb