webkit_remote 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cabab3d3bcf6ae1ce28f16c36d9ed30380702ea
4
- data.tar.gz: b348748fbef56b36f1e29bae10cad76dd267d127
3
+ metadata.gz: c112ed6ae2e4001acb79f3a73b1838fe69ead2f1
4
+ data.tar.gz: d02f2ca1866953a508ee086e6f31073da36918a7
5
5
  SHA512:
6
- metadata.gz: 0a1c6f937194109f5d8c8de7e701b9b0806ced203cd6d6f3611f49ea198fd4ebf2f783cc4adae6578a2cee5d62747510a8e02ae9c4bf1dc24d19ef9176b2090c
7
- data.tar.gz: 1ccb8933bd32fd43cdeb961e2b54b88032f47d813bdee7716cc2bc7494fbb8fb76e32a65083dc37e2955fed3f13ab91180de2f2f74b65a0ca0f6b9371b5311bb
6
+ metadata.gz: 11dd9e7b9cecfde2a016e29cff3cd27b7d1df868aa3cc41e3dff0f59a48d4dfa7a2cda4d2c531bf742c40c6d8c25a36b578ead32530b753eb3f19b09739fc9c3
7
+ data.tar.gz: f3c024ee48d1507279075359099822933408118bb83eb304a9fdccc9a31da72ed22f2a93ba817578681067119f9be73404ea94d0156606a3846053e2593eebff
@@ -1,10 +1,12 @@
1
+ sudo: false
2
+ dist: trusty
1
3
  language: ruby
4
+ addons:
5
+ apt:
6
+ sources:
7
+ - google-chrome
8
+ packages:
9
+ - google-chrome-stable
2
10
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0
6
- before_install:
7
- - "sudo sh -c \"echo \\\"deb http://dl.google.com/linux/deb/ stable main\\\" >> /etc/apt/sources.list\""
8
- - "sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -"
9
- - "sudo apt-get -qq update"
10
- - "sudo apt-get -qq install google-chrome-stable"
11
+ - 2.3.4
12
+ - 2.4.1
data/Gemfile CHANGED
@@ -1,16 +1,15 @@
1
- source 'http://rubygems.org'
2
- gem 'ws_sync_client', '>= 0.1.1'
3
- gem 'posix-spawn', '>= 0.3.8'
1
+ source 'https://rubygems.org'
2
+ gem 'ws_sync_client', '>= 0.1.2'
4
3
 
5
4
  group :development do
6
5
  gem 'bundler', '>= 1.5.3'
7
- gem 'debugger', '>= 1.6.6'
6
+ gem 'byebug', '>= 9.0.6'
8
7
  gem 'jeweler', '>= 2.0.1'
9
8
  gem 'minitest', '>= 5.3.0'
10
9
  gem 'puma', '>= 2.8.0'
11
- gem 'rack', '>= 1.5.2'
12
- gem 'rack-contrib', '>= 1.1.0'
10
+ gem 'rack', '>= 1.6.8'
11
+ gem 'rack-contrib', '>= 1.2.0'
13
12
  gem 'rdoc', '>= 4.1.1'
14
- gem 'simplecov', '>= 0.8.2'
13
+ gem 'simplecov', '>= 0.9.1'
15
14
  gem 'yard', '>= 0.8.7.3'
16
15
  end
@@ -1,89 +1,89 @@
1
1
  GEM
2
- remote: http://rubygems.org/
2
+ remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.3.5)
5
- builder (3.2.2)
6
- columnize (0.3.6)
7
- debugger (1.6.6)
8
- columnize (>= 0.3.1)
9
- debugger-linecache (~> 1.2.0)
10
- debugger-ruby_core_source (~> 1.3.2)
11
- debugger-linecache (1.2.0)
12
- debugger-ruby_core_source (1.3.2)
13
- descendants_tracker (0.0.3)
14
- docile (1.1.3)
15
- faraday (0.9.0)
4
+ addressable (2.4.0)
5
+ builder (3.2.3)
6
+ byebug (9.0.6)
7
+ descendants_tracker (0.0.4)
8
+ thread_safe (~> 0.3, >= 0.3.1)
9
+ docile (1.1.5)
10
+ faraday (0.9.2)
16
11
  multipart-post (>= 1.2, < 3)
17
- git (1.2.6)
18
- github_api (0.11.3)
19
- addressable (~> 2.3)
20
- descendants_tracker (~> 0.0.1)
12
+ git (1.3.0)
13
+ git-version-bump (0.15.1)
14
+ github_api (0.16.0)
15
+ addressable (~> 2.4.0)
16
+ descendants_tracker (~> 0.0.4)
21
17
  faraday (~> 0.8, < 0.10)
22
- hashie (>= 1.2)
23
- multi_json (>= 1.7.5, < 2.0)
24
- nokogiri (~> 1.6.0)
25
- oauth2
26
- hashie (2.0.5)
27
- highline (1.6.21)
28
- jeweler (2.0.1)
18
+ hashie (>= 3.4)
19
+ mime-types (>= 1.16, < 3.0)
20
+ oauth2 (~> 1.0)
21
+ hashie (3.5.5)
22
+ highline (1.7.8)
23
+ jeweler (2.3.7)
29
24
  builder
30
- bundler (>= 1.0)
25
+ bundler (>= 1)
31
26
  git (>= 1.2.5)
32
- github_api
27
+ github_api (~> 0.16.0)
33
28
  highline (>= 1.6.15)
34
29
  nokogiri (>= 1.5.10)
30
+ psych (~> 2.2)
35
31
  rake
36
32
  rdoc
37
- json (1.8.1)
38
- jwt (0.1.11)
39
- multi_json (>= 1.5)
40
- mini_portile (0.5.2)
41
- minitest (5.3.1)
42
- multi_json (1.9.0)
43
- multi_xml (0.5.5)
33
+ semver2
34
+ json (2.1.0)
35
+ jwt (1.5.6)
36
+ mime-types (2.99.3)
37
+ mini_portile2 (2.2.0)
38
+ minitest (5.10.2)
39
+ multi_json (1.12.1)
40
+ multi_xml (0.6.0)
44
41
  multipart-post (2.0.0)
45
- nokogiri (1.6.1)
46
- mini_portile (~> 0.5.0)
47
- oauth2 (0.9.3)
48
- faraday (>= 0.8, < 0.10)
49
- jwt (~> 0.1.8)
42
+ nokogiri (1.8.0)
43
+ mini_portile2 (~> 2.2.0)
44
+ oauth2 (1.4.0)
45
+ faraday (>= 0.8, < 0.13)
46
+ jwt (~> 1.0)
50
47
  multi_json (~> 1.3)
51
48
  multi_xml (~> 0.5)
52
- rack (~> 1.2)
53
- posix-spawn (0.3.8)
54
- puma (2.8.1)
55
- rack (>= 1.1, < 2.0)
56
- rack (1.5.2)
57
- rack-contrib (1.1.0)
58
- rack (>= 0.9.1)
59
- rake (10.1.1)
60
- rdoc (4.1.1)
61
- json (~> 1.4)
62
- simplecov (0.8.2)
49
+ rack (>= 1.2, < 3)
50
+ psych (2.2.4)
51
+ puma (3.9.1)
52
+ rack (1.6.8)
53
+ rack-contrib (1.4.0)
54
+ git-version-bump (~> 0.15)
55
+ rack (~> 1.4)
56
+ rake (12.0.0)
57
+ rdoc (5.1.0)
58
+ semver2 (3.4.2)
59
+ simplecov (0.14.1)
63
60
  docile (~> 1.1.0)
64
- multi_json
65
- simplecov-html (~> 0.8.0)
66
- simplecov-html (0.8.0)
67
- websocket (1.1.2)
61
+ json (>= 1.8, < 3)
62
+ simplecov-html (~> 0.10.0)
63
+ simplecov-html (0.10.1)
64
+ thread_safe (0.3.6)
65
+ websocket (1.2.4)
68
66
  websocket-native (1.0.0)
69
- ws_sync_client (0.1.1)
70
- websocket (>= 1.1.2)
67
+ ws_sync_client (0.1.2)
68
+ websocket (>= 1.2.4)
71
69
  websocket-native (>= 1.0.0)
72
- yard (0.8.7.3)
70
+ yard (0.9.9)
73
71
 
74
72
  PLATFORMS
75
73
  ruby
76
74
 
77
75
  DEPENDENCIES
78
76
  bundler (>= 1.5.3)
79
- debugger (>= 1.6.6)
77
+ byebug (>= 9.0.6)
80
78
  jeweler (>= 2.0.1)
81
79
  minitest (>= 5.3.0)
82
- posix-spawn (>= 0.3.8)
83
80
  puma (>= 2.8.0)
84
- rack (>= 1.5.2)
85
- rack-contrib (>= 1.1.0)
81
+ rack (>= 1.6.8)
82
+ rack-contrib (>= 1.2.0)
86
83
  rdoc (>= 4.1.1)
87
- simplecov (>= 0.8.2)
88
- ws_sync_client (>= 0.1.1)
84
+ simplecov (>= 0.9.1)
85
+ ws_sync_client (>= 0.1.2)
89
86
  yard (>= 0.8.7.3)
87
+
88
+ BUNDLED WITH
89
+ 1.14.6
data/README.md CHANGED
@@ -45,22 +45,8 @@ platform-dependent functionality is launching and shutting down the browser
45
45
  process, everything else should work for any WebKit-based browser that
46
46
  implements the remote debugging protocol.
47
47
 
48
- Google Chrome can be used in a headless environment with
49
- [Xvfb](http://en.wikipedia.org/wiki/Xvfb).
50
-
51
- Install Xvfb on Fedora.
52
-
53
- ```bash
54
- sudo yum install xorg-x11-server-Xvfb
55
- ```
56
-
57
- Install Xvfb on Ubuntu.
58
-
59
- ```bash
60
- sudo apt-get install xvfb
61
- ```
62
-
63
- Xvfb is included in OSX.
48
+ Google Chrome 60 and above
49
+ [can be used in headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome).
64
50
 
65
51
 
66
52
  ## Installation
@@ -241,4 +227,3 @@ unstable features at
241
227
  ## Copyright
242
228
 
243
229
  Copyright (c) 2012 Victor Costan. See LICENSE.txt for further details.
244
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.5
1
+ 0.6.0
@@ -5,7 +5,7 @@ module WebkitRemote
5
5
 
6
6
  # The master connection to the remote debugging server in a Webkit process.
7
7
  class Browser
8
- # Sets up a debugging connection to a Webkit processr.
8
+ # Sets up a debugging connection to a Webkit process.
9
9
  #
10
10
  # @param [Hash] opts info on the browser to connect to
11
11
  # @option opts [String] host the hostname / IP address of the Webkit remote
@@ -21,8 +21,9 @@ module Console
21
21
  #
22
22
  # @return [WebkitRemote::Client] self
23
23
  def clear_console
24
- @rpc.call 'Console.clearMessages'
25
- console_cleared
24
+ @rpc.call 'Runtime.discardConsoleEntries'
25
+ @console_messages.each(&:release_params)
26
+ @console_messages.clear
26
27
  self
27
28
  end
28
29
 
@@ -37,12 +38,6 @@ module Console
37
38
  @console_messages << message
38
39
  end
39
40
 
40
- # @private Called by the ConsoleCleared event constructor.
41
- def console_cleared
42
- @console_messages.each(&:release_params)
43
- @console_messages.clear
44
- end
45
-
46
41
  # @private Called by the Client constructor to set up Console data.
47
42
  def initialize_console
48
43
  @console_events = false
@@ -68,9 +63,6 @@ class ConsoleMessage
68
63
  # The documented values are :debug, :error, :log, :tip, and :warning.
69
64
  attr_reader :level
70
65
 
71
- # @return [Integer] how many times this message was repeated
72
- attr_accessor :count
73
-
74
66
  # @return [Symbol] the component that produced this message
75
67
  #
76
68
  # The documented values are :console_api, :html, :javascript, :network,
@@ -83,12 +75,6 @@ class ConsoleMessage
83
75
  # This is set for console messages that indicate network errors.
84
76
  attr_reader :network_resource
85
77
 
86
- # @return [Symbol] the behavior that produced this message
87
- #
88
- # The documented values are :assert, :dir, :dirxml, :endGroup, :log,
89
- # :startGroup, :startGroupCollapsed, and :trace.
90
- attr_reader :type
91
-
92
78
  # @return [String] the URL of the file that caused this message
93
79
  attr_reader :source_url
94
80
 
@@ -121,7 +107,6 @@ class ConsoleMessage
121
107
  @params = []
122
108
  end
123
109
  @params.freeze
124
- @count = raw_message['repeatCount'] ? raw_message['repeatCount'].to_i : 1
125
110
  if raw_message['source']
126
111
  @reason = raw_message['source'].gsub('-', '_').to_sym
127
112
  else
@@ -129,7 +114,6 @@ class ConsoleMessage
129
114
  end
130
115
  @stack_trace = self.class.parse_stack_trace raw_message['stackTrace']
131
116
  @text = raw_message['text']
132
- @type = raw_message['type'] ? raw_message['type'].to_sym : nil
133
117
  @source_url = raw_message['url']
134
118
  end
135
119
 
@@ -48,31 +48,6 @@ class ConsoleMessage < WebkitRemote::Event
48
48
  end
49
49
  end # class WebkitRemote::Event::ConsoleMessage
50
50
 
51
- # Emitted when the same console message is produced repeatedly.
52
- class ConsoleMessageRepeated < WebkitRemote::Event
53
- register 'Console.messageRepeatCountUpdated'
54
-
55
- # @return [WebkitRemote::Client::ConsoleMessage] the repeated message
56
- attr_reader :message
57
-
58
- # @return [Number] the number of times that the message was repeated
59
- attr_reader :count
60
-
61
- # @private Use Event#for instead of calling this constructor directly.
62
- def initialize(rpc_event, client)
63
- super
64
-
65
- @message = client.console_messages.last
66
- @count = raw_data['count'] ? raw_data['count'].to_i : nil
67
- @message.count = @count if @count
68
- end
69
-
70
- # @private Use Event#can_receive instead of calling this directly.
71
- def self.can_reach?(client)
72
- client.console_events
73
- end
74
- end # class WebkitRemote::Event::ConsoleMessageRepeated
75
-
76
51
  # Emitted when the console is cleared.
77
52
  class ConsoleCleared < WebkitRemote::Event
78
53
  register 'Console.messagesCleared'
@@ -33,6 +33,11 @@ module Input
33
33
 
34
34
  options[:timestamp] = opts[:time] if opts[:time]
35
35
  options[:clickCount] = opts[:clicks] if opts[:clicks]
36
+ if opts[:button]
37
+ options[:button] = opts[:button].to_s
38
+ else
39
+ options[:button] = 'none'
40
+ end
36
41
  if opts[:modifiers]
37
42
  flags = 0
38
43
  opts[:modifiers].each do |modifier|
@@ -71,7 +76,7 @@ module Input
71
76
  # useful for shortcut (accelerator) key handling; ('' by default)
72
77
  # @option opts [Number] vkey the Windows virtual key code for the key;
73
78
  # see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Virtual_key_codes
74
- # @option opts [Number] key_id the unique key identifier (e.g., 'U+0041');
79
+ # @option opts [Number] key the unique key identifier (e.g., 'U+0041');
75
80
  # ('' by default)
76
81
  # @option opts [Boolean] auto_repeat true if the event was generated by an
77
82
  # auto-repeat while the key was being held down
@@ -112,7 +117,7 @@ module Input
112
117
  options[:modifiers] = flags
113
118
  end
114
119
 
115
- options[:keyIdentifier] = opts[:key_id] if opts[:key_id]
120
+ options[:key] = opts[:key] if opts[:key]
116
121
  options[:windowsVirtualKeyCode] = opts[:vkey] if opts[:vkey]
117
122
  options[:unmodifiedText] = opts[:unmodified_text] if opts[:unmodified_text]
118
123
  if opts[:text]
@@ -133,4 +138,3 @@ include WebkitRemote::Client::Input
133
138
  end # namespace WebkitRemote::Client
134
139
 
135
140
  end # namespace WebkitRemote
136
-
@@ -150,12 +150,6 @@ class NetworkRequest < WebkitRemote::Event
150
150
  @redirect_response = WebkitRemote::Client::NetworkResponse.new(
151
151
  raw_data['redirectResponse'])
152
152
  end
153
- if raw_data['stackTrace']
154
- @stack_trace = WebkitRemote::Client::ConsoleMessage.parse_stack_trace(
155
- raw_initiator['stackTrace'])
156
- else
157
- @stack_trace = nil
158
- end
159
153
  @timestamp = raw_data['timestamp']
160
154
 
161
155
  @resource = client.network_resource raw_data['requestId']
@@ -509,7 +503,8 @@ class NetworkRequestInitiator
509
503
  # @return [Number] number of the line that references the requested resource
510
504
  attr_reader :line
511
505
 
512
- # @return [WebkitRemote::Console
506
+ # @return [WebkitRemote::Client::StackTrace] JavaScript trace, set only for
507
+ # :script initiators
513
508
  attr_reader :stack_trace
514
509
 
515
510
  # @private Use Event#for instead of calling this constructor directly
@@ -519,8 +514,8 @@ class NetworkRequestInitiator
519
514
  else
520
515
  @line = nil
521
516
  end
522
- @stack_trace = WebkitRemote::Client::ConsoleMessage.parse_stack_trace(
523
- raw_initiator['stackTrace'])
517
+
518
+ @stack_trace = WebkitRemote::Client::StackTrace.parse raw_initiator['stack']
524
519
  @type = (raw_initiator['type'] || 'other').to_sym
525
520
  @url = raw_initiator['url']
526
521
  end
@@ -13,19 +13,19 @@ module Page
13
13
  self
14
14
  end
15
15
 
16
- # Reloads
16
+ # Reloads the current page.
17
17
  #
18
18
  # @param [Hash] opts quirky behavior bits
19
19
  # @option opts [Boolean] skip_cache if true, the cache is not used; this is
20
- # what happens when the user presses Shift+refresh
20
+ # what happens when the user presses Shift + the refresh combo
21
21
  # @option opts [String] onload a JavaScript that will be injected in all the
22
22
  # page's frames after reloading
23
23
  # @return [WebkitRemote::Client] self
24
- def refresh(opts = {})
24
+ def reload(opts = {})
25
25
  options = {}
26
26
  options[:ignoreCache] = true if opts[:skip_cache]
27
27
  options[:scriptToEvaluateOnLoad] = opts[:onload] if opts[:onload]
28
- @rpc.call 'Page.refresh', options
28
+ @rpc.call 'Page.reload', options
29
29
  self
30
30
  end
31
31
 
@@ -104,10 +104,6 @@ class UndefinedClass
104
104
  true
105
105
  end
106
106
 
107
- def nil?
108
- true
109
- end
110
-
111
107
  def to_a
112
108
  []
113
109
  end
@@ -506,6 +502,62 @@ class JsProperty
506
502
  end
507
503
  end # class WebkitRemote::Client::JsProperty
508
504
 
505
+ # The call stack that represents the context of an assertion or error.
506
+ class StackTrace
507
+ # Parses a StackTrace object returned by a RPC request.
508
+ #
509
+ # @param [Array<String, Object>] raw_stack_trace the raw StackTrace object
510
+ # in the Runtime domain returned by an RPC request
511
+ def initialize(raw_stack_trace)
512
+ @description = raw_stack_trace['description']
513
+ @frames = raw_stack_trace['callFrames'].map do |raw_frame|
514
+ frame = {}
515
+ if raw_frame['columnNumber']
516
+ frame[:column] = raw_frame['columnNumber'].to_i
517
+ end
518
+ if raw_frame['lineNumber']
519
+ frame[:line] = raw_frame['lineNumber'].to_i
520
+ end
521
+ if raw_frame['functionName']
522
+ frame[:function] = raw_frame['functionName']
523
+ end
524
+ if raw_frame['url']
525
+ frame[:url] = raw_frame['url']
526
+ end
527
+ frame
528
+ end
529
+
530
+ parent_trace = raw_stack_trace['parent']
531
+ if parent_trace
532
+ @parent = StackTrace.new parent_trace
533
+ else
534
+ @parent = nil
535
+ end
536
+ end
537
+
538
+ # @return [String] label of the trace; for async traces, might be the name of
539
+ # a function that initiated the async call
540
+ attr_reader :description
541
+
542
+ # @return [Array<Symbol, Object>] Ruby-friendly stack trace
543
+ attr_reader :frames
544
+
545
+ # @return [WebkitRemote::Client::StackTrace] stack trace for a parent async
546
+ # call; may be null
547
+ attr_reader :parent
548
+
549
+ # Parses a StackTrace object returned by a RPC request.
550
+ #
551
+ # @param [Array<String, Object>] raw_stack_trace the raw StackTrace object
552
+ # in the Runtime domain returned by an RPC request
553
+ # @return [WebkitRemote::Client::StackTrace]
554
+ def self.parse(raw_stack_trace)
555
+ return nil unless raw_stack_trace
556
+
557
+ StackTrace.new raw_stack_trace
558
+ end
559
+ end # class WebkitRemote::Client::StackTrace
560
+
509
561
  end # namespace WebkitRemote::Client
510
562
 
511
563
  end # namespace WebkitRemote