Step-by-step guide on starting Edge with Open package on Windows 10

I am utilizing the Open package to launch URLs across different browsers. Unfortunately, there is a lack of comprehensive documentation on how to specifically launch with different browsers on various operating systems.

After some experimentation, I have discovered that for Mac, you can use:

const open = require('open');

await open('https://www.github.com', { app: 'microsoft edge' });

This indicates that the keyword for Mac is microsoft edge.

Now, I am attempting to determine the correct keyword for Windows. I have tried using microsoft edge, as well as microsoft-edge:

await open('https://www.github.com', { app: 'microsoft-edge' });

and even just edge:

await open('https://www.github.com', { app: 'edge' });

Unfortunately, none of these options seem to be successful in launching the specified browser on Windows.

If anyone has insight into the correct keyword for Windows, please share!

Answer №2

Special thanks to Deepak-MSFT for guiding me in the right direction. The crucial point is that the keyword must match the name of the .exe file. In my scenario, the name was msedge, and this snippet of code successfully worked on my Windows 10 system.

await open('https://www.github.com', { app: 'msedge' });

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Update the parent node in the Google Org Chart

This is my first time working with Google Charts and I have a couple of questions: Is there a method in the API to update the parent of an existing node? I am facing a challenge where I need to build a tree structure top-down, which means that I know the ...

Managing Start Up Applications in C/C++ on Windows operating system

Recently, I came across a project that requires editing Windows' Start Up Programs. However, I am having trouble figuring out where to start. Could someone provide me with references to some Windows API functions that can help me achieve this task? M ...

Creating an Apache Cordova Build Command

Currently, I am in the process of setting up Apache Cordova on Ubuntu 13.10 by following the steps outlined here: I encountered a roadblock when trying to complete the "Build the App" section: Once I successfully added the "ubuntu" platform, I received t ...

Angular-cli does not come with the Bootstrap framework pre-installed

After installing the bootstrap framework to my angular2 project through npm, I noticed that it appeared in the node-modules folder. However, upon checking the angular-cli file, I discovered that the boostrap script and css were not included. "apps": [ ...

Download the browser version of UglifyJS 2 now

Is there a way to download the browser version of UglifyJS 2 without having to build it myself? I'm running into issues with the manual installation. I used npm to install uglify-js, but I can't seem to find where to execute the uglifyjs --self ...

Having difficulty implementing a personalized color scheme for the mui component

Attempting to set the background color as midnightBlue but encountering an error: Error: Cannot read properties of undefined (reading '100') Upon reviewing the syntax, no errors were found. Perhaps this issue stems from a dependency problem? ...

Load Bootstrap 4 Modal with Ajax

I recently upgraded from Bootstrap 3 to Bootstrap 4.1 Within my applications, I utilize ajax loaded modals. In the layout, I have: <div class="modal fade" id="myModalToFillInfo" tabindex="-1" role="dialog" aria-labelledby="myModalToFillInfoLabel" ari ...

Utilize JavaScript when sharing on social media to avoid the possibility of embedding the entire

This javascript code snippet is extracted from www.twitter.com (simply click to view the source code). I have reformatted it for better readability: if (window.top !== window.self) { document.write = ""; window.top.location = window.self.location; s ...

Perfect location for universal npm installation on CentOS 7

I have a production CentOS 7 setup that installs global packages in /root/node_modules, making them unavailable system-wide. Even though npm root confirms this, I'd rather avoid using prefix or other NVM-style workarounds. Experimenting with installi ...

What is the process for submitting a form on consecutive URLs?

I have a form that requires input for settings and includes two buttons: one to save the form and another to both save and execute the settings. <form method="post" action="/settings/{{id}}/save"> <!-- input fields --> ...

AngularJS: monitoring changes in an array property

For the problem at hand, take a look at this link: http://plnkr.co/edit/ZphAKvZeoVtuGFSEmOKg?p=preview Imagine you have an array structured like this: var arr = [ { 'a': "123", 'b': "654" }, { 'a': "456", &apo ...

The Material UI list element fails to appear on the screen

I am encountering an issue where I am trying to display a Material UI list within a drop-down menu (using the Material UI drawer component) for mobile view, but the actual list is not appearing as expected. The code snippet for the list is as follows: con ...

Populating a form field using another input

I am facing an issue with retrieving the price of a product in one field when the product name is selected in another field on a simple POS system. It works fine for the first product, but when I add another row for the next product, the price does not dis ...

Encountered an issue while deploying on Firebase through npm using the command --prefix $RESOURCE_DIR run

Recently, I installed Firebase tools by following a helpful tutorial. Now, as I attempt to upload my first Firebase function, I encountered an issue with the hello-world example that was set up during the initialization process with firebase init (specific ...

Unable to display Bootstrap 5 modal

I am currently in the process of constructing a basic webpage that includes a navigation bar and a table. The table rows are being dynamically generated through a simple JavaScript script that fetches data asynchronously from a database. I opted to utilize ...

Combining two objects in AngularJS to create a new merged object

Is there a way to merge object1 and object2 into object3, updating values corresponding to matching keys while ignoring unmatching keys? var object1 = { "pii" : "val1", "loc" : "val2" } var object2 = { "rrb" : "val3", "voc" : "val4" } var obje ...

Node.JS Logic for Scraping and Extracting Time from Text

Currently, I am working on developing a web scraper to gather information about local events from various sites. One of my challenges is extracting event times as they are inputted in different formats by different sources. I'm seeking advice on how t ...

Having trouble with the functionality of expanding rows in Kendo grid

I am facing an issue with my Kendo grid that is populated from a SQL database. The expand feature works perfectly and displays a different Kendo grid in the expanded row when the program is first launched. However, if I perform a new search and get differe ...

Enable retrieval of calculated time duration in jQuery time picker

After implementing two separate timepickers for calculating a time duration, I am looking to access this computed duration for further calculations later on the page. How can I retrieve the duration that is already displayed to the user after using the sec ...

What steps can I take to resolve this issue when encountering an error during npm install?

As a newcomer to programming, I am embarking on the creation of a Discord bot using node and discord.js. My current hurdle involves the installation of a library named canvas, which seems to be causing issues. After developing and testing my application o ...