GithubHelp home page GithubHelp logo

Comments (12)

harthur avatar harthur commented on June 1, 2024

I think the toolbox should close without prompting if it's in the sidebar or bottom of the browser.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

Yeah. I don't know yet what to do for the frontend part. But for sure, we need (cancelable?) events to handle the destruction of a target.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

Maybe a target should be a more complex object that can fire events. (just a thought).

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

Events the target should fire:

  • destroy (tab closed)
  • hide / show (tab switching)
  • unload (before reload or tab close)
  • load (once a new root document (tab.linkedBrowser.contentWindow/contentDocument) is available)

Probably more to come when we'll support remote targets.

from devtools-window.

joewalker avatar joewalker commented on June 1, 2024

I've suggested an updated target API here: #72 perhaps that helps with this question.

from devtools-window.

harthur avatar harthur commented on June 1, 2024

Thanks Joe, I'll try this out in our Toolbox code.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

Update: this is what I think we need:

  • will-close (optional and cancelable)
  • close
  • will-navigate (optional and cancelable)
  • navigate

I don't think we need reload and change.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

I'll take care of that.

from devtools-window.

past avatar past commented on June 1, 2024

For remote targets, close will have to fire when a tabDetached packet is received, but I don't think we can implement a cancelable will-close, since we don't have that kind of control over the remote process. The web console has a locationChanged packet that is set twice, mimicking will-navigate/navigate, but the debugger only has a single tabNavigated packet that corresponds to navigate.

We have a bug on file to use the web console's behavior with the tabNavigated packet type though. I don't believe locationChanged/tabNavigated is cancelable, either and I doubt such a protocol change would be welcome.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

"Cancelability" is optional. will-close and will-navigate are optional.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

Update, for tabs, I'm implementing these events:

close
will-navigate (cancelable)
navigate
hidden
visible

The mandatory events should me:

close
navigate

The target, after firing "close", should destroy itself.

from devtools-window.

paulrouget avatar paulrouget commented on June 1, 2024

fixed by PR #231

from devtools-window.

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.