GithubHelp home page GithubHelp logo

Warnings about ferrum HOT 3 CLOSED

rubycdp avatar rubycdp commented on May 22, 2024
Warnings

from ferrum.

Comments (3)

route avatar route commented on May 22, 2024 1

@Mifrill I think we can remove it, agree

from ferrum.

Mifrill avatar Mifrill commented on May 22, 2024

@jamarat thanks for the raising the flag!

The first case looks weird:

https://github.com/Mifrill/ferrum/blob/master/lib/ferrum/context.rb#L44-L52

    def create_target
      target_id = @browser.command("Target.createTarget",
                                   browserContextId: @id,
                                   url: "about:blank")["targetId"]
      target = @pendings.take(@browser.timeout)
      raise NoSuchTargetError unless target.is_a?(Target)
      @targets[target.id] = target
      target
    end

we probably should remove the declaration of target_id at all here:

	  target = @pendings.take(@browser.timeout)
      raise NoSuchTargetError unless target.is_a?(Target)
      @targets[target.id] = target
      target

or we should to apply something like this:

target = @targets[target_id] || @pendings.take(@browser.timeout)

because we may have nothing in @pendings Concurrent::MVar on @pendings.take fire, according to logic in #add_target:

	def add_target(params)
      target = Target.new(@browser, params)
      if target.window?
        @targets[target.id] = target
      else
        @pendings.put(target, @browser.timeout)
      end
    end

from ferrum.

Mifrill avatar Mifrill commented on May 22, 2024

@route we can't just remove this declaration, because we should trigger the subscriber event here:
https://github.com/Mifrill/ferrum/blob/ecab9ec5a0aa8454e7021bc5fcfc8c5f1c3fb6f7/lib/ferrum/contexts.rb#L48
by browser.client.on("Target.targetCreated") to Creates a new page.
https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-createTarget

from ferrum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.