babakfp
babakfp•9mo ago

Looking for an alternative to x/deno_open

Hi 👋 I'm using the --unstable-hmr option with Deno and whenever I modify code and save, this library opens a new window! I'm looking for a library that checks if the basepath (http://localhost:3000) is already open, if it is open, it doesn't do anything, meaning if http://localhost:3000/something was open, it still won't do anything and only if http://localhost:3000 wasn't open it opens it in a new browser window. https://deno.land/x/deno_open@v0.0.6
3 Replies
Deno AI Helper
Deno AI Helper•9mo ago
Hello 👋, I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, it seems like you're looking for a library that can manage browser windows more intelligently when using Deno's hot module reloading feature. While I can't recommend a specific library that fulfills your exact requirements, I can suggest that you might need to implement a custom solution that involves checking for existing browser tabs before opening a new one. This functionality is not typically provided by Deno's standard library or existing third-party modules due to the limitations of Deno's sandbox and the security model. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. You might need to look into browser-specific APIs or extensions that can communicate with Deno to achieve the desired behavior, but this would likely involve stepping outside of Deno's standard capabilities. If you have any further Deno-related questions or need assistance with Deno's features, feel free to ask!
Leokuma
Leokuma•9mo ago
My suggestion is to disable auto-opening the browser, at least during development. Open it manually
babakfp
babakfpOP•9mo ago
Yep, I exactly did that. Thanks.

Did you find this page helpful?