-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Conversation
ziflex
commented
Jun 18, 2019
- Refactored driver's design
- Added new struct - Page
- Added support of multiple frames
|
||
h := fnv.New64a() | ||
|
||
h.Write([]byte(doc.Type().String())) | ||
h.Write([]byte(":")) | ||
h.Write([]byte(doc.url)) | ||
h.Write([]byte(doc.frames.Frame.ID)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
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
)
pkg/drivers/cdp/page.go
Outdated
err = p.document.Close() | ||
|
||
if err != nil { | ||
errs = append(errs, errors.Wrapf(err, "failed to close root document: %s", p.document.GetURL())) |
There was a problem hiding this comment.
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
)
pkg/drivers/cdp/element.go
Outdated
el.mu.Lock() | ||
defer el.mu.Unlock() | ||
|
||
return el.connected | ||
return el.connected == false |
There was a problem hiding this comment.
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
)
pkg/drivers/common/frames.go
Outdated
|
||
err = CollectFrames(ctx, receiver, childDoc) | ||
|
||
if err != nil { |
There was a problem hiding this comment.
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 Report
@@ 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 |
pkg/drivers/cdp/helpers.go
Outdated
return values.NewString(repl.String()), nil | ||
} | ||
|
||
func loadInnerTextByNodeID(ctx context.Context, client *cdp.Client, exec *eval.ExecutionContext, nodeID dom.NodeID) (values.String, error) { |
There was a problem hiding this comment.
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
)