mirror of
https://github.com/MontFerret/ferret.git
synced 2025-04-13 11:50:30 +02:00
* Refactored networking * Some work * Added event loop * Renamed EventHandler to Handler * wip * Removed console logs * Added DOMManager * Refactored frame managment * Fixes * Fixed concurrency issues * Fixed unit tests * Improved EventLoop api * Some fixes * Refactored event loop. * Improved logic of initial page load * Cleaned up * Fixed linting issues * Fixed dom.Manager.Close * SOme works * Fixes * Removed fmt.Println statements * Refactored WaitForNavigation * Removed filter for e2e tests * Made Cookies Measurable * Made Cookies KeyedCollection * Fixes after code review * Updated e2e tests for iframes * Fixed iframe lookup in e2e tests * Added comments
19 lines
230 B
Go
19 lines
230 B
Go
package events
|
|
|
|
import (
|
|
"context"
|
|
"hash/fnv"
|
|
)
|
|
|
|
func New(name string) ID {
|
|
h := fnv.New32a()
|
|
|
|
h.Write([]byte(name))
|
|
|
|
return ID(h.Sum32())
|
|
}
|
|
|
|
func isCtxDone(ctx context.Context) bool {
|
|
return ctx.Err() == context.Canceled
|
|
}
|