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

Feature/#220 iframe support #315

Merged
merged 25 commits into from
Jun 19, 2019
Merged

Feature/#220 iframe support #315

merged 25 commits into from
Jun 19, 2019

Conversation

ziflex
Copy link
Member

@ziflex ziflex commented Jun 18, 2019

  • Refactored driver's design
  • Added new struct - Page
  • Added support of multiple frames

@ziflex ziflex added type/enhancement New feature or request area/drivers/cdp Cdp driver area/drivers/http Http driver area/drivers HTML drivers labels Jun 18, 2019

h := fnv.New64a()

h.Write([]byte(doc.Type().String()))
h.Write([]byte(":"))
h.Write([]byte(doc.url))
h.Write([]byte(doc.frames.Frame.ID))

Choose a reason for hiding this comment

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

Error return value of h.Write is not checked (from errcheck)


h := fnv.New64a()

h.Write([]byte(doc.Type().String()))
h.Write([]byte(":"))
h.Write([]byte(doc.url))
h.Write([]byte(doc.frames.Frame.ID))
h.Write([]byte(doc.frames.Frame.URL))

Choose a reason for hiding this comment

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

Error return value of h.Write is not checked (from errcheck)

evtID := evt.Result.ObjectID

// release the event object
defer ec.client.Runtime.ReleaseObject(ctx, runtime.NewReleaseObjectArgs(*evtID))

Choose a reason for hiding this comment

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

Error return value of ec.client.Runtime.ReleaseObject is not checked (from errcheck)


h := fnv.New64a()

h.Write([]byte("CDP"))

Choose a reason for hiding this comment

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

Error return value of h.Write is not checked (from errcheck)

err = p.document.Close()

if err != nil {
errs = append(errs, errors.Wrapf(err, "failed to close root document: %s", p.document.GetURL()))

Choose a reason for hiding this comment

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

ineffectual assignment to errs (from ineffassign)

el.mu.Lock()
defer el.mu.Unlock()

return el.connected
return el.connected == false

Choose a reason for hiding this comment

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

S1002: should omit comparison to bool constant, can be simplified to !el.connected (from gosimple)


err = CollectFrames(ctx, receiver, childDoc)

if err != nil {

Choose a reason for hiding this comment

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

S1008: should use 'return ' instead of 'if { return }; return ' (from gosimple)

@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

Merging #315 into master will decrease coverage by 14.2%.
The diff coverage is 0.6%.

@@           Coverage Diff            @@
##           master   #315      +/-   ##
========================================
- Coverage    54.2%    40%   -14.2%     
========================================
  Files         197    205       +8     
  Lines        6189   8398    +2209     
========================================
+ Hits         3355   3358       +3     
- Misses       2484   4690    +2206     
  Partials      350    350

return values.NewString(repl.String()), nil
}

func loadInnerTextByNodeID(ctx context.Context, client *cdp.Client, exec *eval.ExecutionContext, nodeID dom.NodeID) (values.String, error) {

Choose a reason for hiding this comment

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

loadInnerTextByNodeID is unused (from deadcode)

@ziflex ziflex merged commit d7b923e into master Jun 19, 2019
@ziflex ziflex deleted the feature/#220-iframe-support branch June 19, 2019 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/drivers/cdp Cdp driver area/drivers/http Http driver area/drivers HTML drivers type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants