Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
forks
Webshot
Commits
6b5a9c58
Commit
6b5a9c58
authored
7 years ago
by
王志成
Browse files
Options
Download
Email Patches
Plain Diff
打开网页使用width属性设置浏览器宽度
parent
0451c649
image_width
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/webshot/screenshot.rb
+3
-0
lib/webshot/screenshot.rb
with
3 additions
and
0 deletions
+3
-0
lib/webshot/screenshot.rb
View file @
6b5a9c58
...
...
@@ -59,6 +59,9 @@ module Webshot
full
=
opts
.
fetch
(
:full
,
true
)
selector
=
opts
.
fetch
(
:selector
,
nil
)
allowed_status_codes
=
opts
.
fetch
(
:allowed_status_codes
,
[])
Capybara
.
page
.
driver
.
browser
.
resize
(
width
,
height
)
# Check response code
status_code
=
page
.
driver
.
status_code
.
to_i
unless
valid_status_code?
(
status_code
,
allowed_status_codes
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help