Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to set custom viewport size #334

Merged
merged 5 commits into from
Jul 17, 2019
Merged

Conversation

ziflex
Copy link
Member

@ziflex ziflex commented Jul 16, 2019

Added new settings:

LET p = DOCUMENT(url, {
    driver: "cdp",
    viewport: {
        width: 1024,
        height: 768,
        landscape: false,
        mobile: false,
        scaleFactor: 1
   }
})

@ziflex ziflex requested a review from 3timeslazy July 16, 2019 22:53
@@ -20,6 +20,11 @@ const DriverName = "cdp"
const BlankPageURL = "about:blank"
const DefaultTimeout = 5000 * time.Millisecond

var defaultScreenSize = &drivers.ScreenSize{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultScreenSize is unused (from deadcode)

},

func() error {
if params.Screen != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make

if params.Screen == nil { return nil } 

first pls

@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #334 into master will decrease coverage by <.1%.
The diff coverage is 5.7%.

@@           Coverage Diff            @@
##           master    #334     +/-   ##
========================================
- Coverage    39.7%   39.7%   -<.1%     
========================================
  Files         217     217             
  Lines        8563    8587     +24     
========================================
+ Hits         3401    3410      +9     
- Misses       4809    4825     +16     
+ Partials      353     352      -1

@ziflex ziflex merged commit 6320114 into master Jul 17, 2019
@ziflex ziflex deleted the refactoring/screen-size branch July 17, 2019 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants