Giter VIP home page Giter VIP logo

Comments (6)

amodm avatar amodm commented on May 18, 2024

What should be the most appropriate behaviour here? opening using open_with_url_and_target with target as _blank?

from webbrowser-rs.

vbeffa avatar vbeffa commented on May 18, 2024

Actually, I think it might be better to add a new function open_with_target that takes both the url and target as parameters. That way the signature of open doesn't need to change.

from webbrowser-rs.

vbeffa avatar vbeffa commented on May 18, 2024

Here's a PR: #40

from webbrowser-rs.

amodm avatar amodm commented on May 18, 2024

Unless there's a noticeable demand for open_with_target kind of behaviour, I'm not inclined to add a new function, as removals end up being tricky later.

I'm ok with the current behaviour of open_browser to default to a target of _blank (in case of wasm), or whatever makes it open a new tab, to make sure that it becomes consistent with how a lot of other browsers end up behaving.

But specifying a target programmatically will need more thought, and I wouldn't want to delay this change as I'm planning a release in the next few days.

from webbrowser-rs.

amodm avatar amodm commented on May 18, 2024

@vbeffa I've modified the wasm code to open in _blank by default. This can be overridden by WEBBROWSER_WASM_TARGET env at compile time (the test uses this to set target to _self, for example).

The reason why I've kept it like this is because it's not possible to provide consistent behaviour as of now in selecting target names across different browsers. If there's a recurring demand for this, I'll revisit this choice.

This will go out in the next release (planned by end of this week).

from webbrowser-rs.

vbeffa avatar vbeffa commented on May 18, 2024

@amodm thank you.

from webbrowser-rs.

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.