Comments (6)
What should be the most appropriate behaviour here? opening using open_with_url_and_target with target as _blank
?
from webbrowser-rs.
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.
Here's a PR: #40
from webbrowser-rs.
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.
@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.
@amodm thank you.
from webbrowser-rs.
Related Issues (20)
- Not working for some browsers HOT 4
- add support for wasm HOT 3
- Option to specify user HOT 4
- Option to set target "_blank" on wasm HOT 1
- Run silently HOT 2
- all `open_browser()` calls should block HOT 4
- url parameter is treated as file link if the last character is a space HOT 2
- Feature Request: window size and position HOT 2
- Current function signature is too restrictive HOT 2
- Ability to choose the target for opening in wasm HOT 2
- detect if browser is available without opening a url HOT 4
- Promote to v1.0.0 if no API changes by Mar 1st, 2024 HOT 6
- Use of `ndk-glue` for Android builds causes conflicts
- panics on termux HOT 6
- Issue with Ubuntu 22.04, does not open web browser, instead opens mime-type file associated application. HOT 18
- xdg-open return value not respected HOT 2
- Opening https:// links opens a temporary file on Windows 10 when using Firefox or Chrome as default browser HOT 7
- Flatpak Support HOT 11
- Program panics on windows 10 with the message 'The system cannot find the file specified.' HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webbrowser-rs.