Launching Microsoft Edge browser from a Microsoft javascript file?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
var oIE = new ActiveXObject("InternetExplorer.Application");
var URLname1 = "http://www.google.com";
var URLname2 = "http://www.bing.com";
var navOpenInBackgroundTab = 0x1000;
oIE.Visible = true;
oIE.Navigate2(URLname1);
oIE.Navigate2(URLname2, navOpenInBackgroundTab);
Above is a bit of code in my javascript file (launch.js) that launches Internet Explorer with a specific webpage and then opens a new tab in the same browser window using a 2nd URL.
How do you launch the Microsoft Edge browser instead of IE in Windows 10 using ActiveXObject() or another similar method? I cannot find the "InternetExplorer.Application" equivalent for Microsoft Edge.
javascript internet-explorer activex windows-10 microsoft-edge
add a comment |
var oIE = new ActiveXObject("InternetExplorer.Application");
var URLname1 = "http://www.google.com";
var URLname2 = "http://www.bing.com";
var navOpenInBackgroundTab = 0x1000;
oIE.Visible = true;
oIE.Navigate2(URLname1);
oIE.Navigate2(URLname2, navOpenInBackgroundTab);
Above is a bit of code in my javascript file (launch.js) that launches Internet Explorer with a specific webpage and then opens a new tab in the same browser window using a 2nd URL.
How do you launch the Microsoft Edge browser instead of IE in Windows 10 using ActiveXObject() or another similar method? I cannot find the "InternetExplorer.Application" equivalent for Microsoft Edge.
javascript internet-explorer activex windows-10 microsoft-edge
Microsoft Edge no longer supports ActiveX blogs.windows.com/msedgedev/2015/05/06/… Where are you lanching the launch.js from?
– Roman Canlas
Nov 9 '15 at 20:18
Hi Roman. I'm executing the script .js file from my desktop. So the javescript code itself is being executed by Window's JavaScript Runtime and not Edge or IE.
– Castaa
Nov 9 '15 at 21:42
so it's like you're double clicking the .js file from the desktop or does it get executed on Windows startup?
– Roman Canlas
Nov 9 '15 at 21:48
I'm double clicking, yes.
– Castaa
Nov 9 '15 at 21:56
add a comment |
var oIE = new ActiveXObject("InternetExplorer.Application");
var URLname1 = "http://www.google.com";
var URLname2 = "http://www.bing.com";
var navOpenInBackgroundTab = 0x1000;
oIE.Visible = true;
oIE.Navigate2(URLname1);
oIE.Navigate2(URLname2, navOpenInBackgroundTab);
Above is a bit of code in my javascript file (launch.js) that launches Internet Explorer with a specific webpage and then opens a new tab in the same browser window using a 2nd URL.
How do you launch the Microsoft Edge browser instead of IE in Windows 10 using ActiveXObject() or another similar method? I cannot find the "InternetExplorer.Application" equivalent for Microsoft Edge.
javascript internet-explorer activex windows-10 microsoft-edge
var oIE = new ActiveXObject("InternetExplorer.Application");
var URLname1 = "http://www.google.com";
var URLname2 = "http://www.bing.com";
var navOpenInBackgroundTab = 0x1000;
oIE.Visible = true;
oIE.Navigate2(URLname1);
oIE.Navigate2(URLname2, navOpenInBackgroundTab);
Above is a bit of code in my javascript file (launch.js) that launches Internet Explorer with a specific webpage and then opens a new tab in the same browser window using a 2nd URL.
How do you launch the Microsoft Edge browser instead of IE in Windows 10 using ActiveXObject() or another similar method? I cannot find the "InternetExplorer.Application" equivalent for Microsoft Edge.
javascript internet-explorer activex windows-10 microsoft-edge
javascript internet-explorer activex windows-10 microsoft-edge
edited Nov 15 '15 at 21:17
Roman Canlas
1,55131218
1,55131218
asked Nov 9 '15 at 18:51
CastaaCastaa
14018
14018
Microsoft Edge no longer supports ActiveX blogs.windows.com/msedgedev/2015/05/06/… Where are you lanching the launch.js from?
– Roman Canlas
Nov 9 '15 at 20:18
Hi Roman. I'm executing the script .js file from my desktop. So the javescript code itself is being executed by Window's JavaScript Runtime and not Edge or IE.
– Castaa
Nov 9 '15 at 21:42
so it's like you're double clicking the .js file from the desktop or does it get executed on Windows startup?
– Roman Canlas
Nov 9 '15 at 21:48
I'm double clicking, yes.
– Castaa
Nov 9 '15 at 21:56
add a comment |
Microsoft Edge no longer supports ActiveX blogs.windows.com/msedgedev/2015/05/06/… Where are you lanching the launch.js from?
– Roman Canlas
Nov 9 '15 at 20:18
Hi Roman. I'm executing the script .js file from my desktop. So the javescript code itself is being executed by Window's JavaScript Runtime and not Edge or IE.
– Castaa
Nov 9 '15 at 21:42
so it's like you're double clicking the .js file from the desktop or does it get executed on Windows startup?
– Roman Canlas
Nov 9 '15 at 21:48
I'm double clicking, yes.
– Castaa
Nov 9 '15 at 21:56
Microsoft Edge no longer supports ActiveX blogs.windows.com/msedgedev/2015/05/06/… Where are you lanching the launch.js from?
– Roman Canlas
Nov 9 '15 at 20:18
Microsoft Edge no longer supports ActiveX blogs.windows.com/msedgedev/2015/05/06/… Where are you lanching the launch.js from?
– Roman Canlas
Nov 9 '15 at 20:18
Hi Roman. I'm executing the script .js file from my desktop. So the javescript code itself is being executed by Window's JavaScript Runtime and not Edge or IE.
– Castaa
Nov 9 '15 at 21:42
Hi Roman. I'm executing the script .js file from my desktop. So the javescript code itself is being executed by Window's JavaScript Runtime and not Edge or IE.
– Castaa
Nov 9 '15 at 21:42
so it's like you're double clicking the .js file from the desktop or does it get executed on Windows startup?
– Roman Canlas
Nov 9 '15 at 21:48
so it's like you're double clicking the .js file from the desktop or does it get executed on Windows startup?
– Roman Canlas
Nov 9 '15 at 21:48
I'm double clicking, yes.
– Castaa
Nov 9 '15 at 21:56
I'm double clicking, yes.
– Castaa
Nov 9 '15 at 21:56
add a comment |
2 Answers
2
active
oldest
votes
Create an instance of the WSH Shell object instead:
var oShell = new ActiveXObject("WScript.Shell");
oShell.Run("cmd.exe /C start microsoft-edge:http://www.microsoft.com");
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
|
show 1 more comment
I had faced a similar issue. Windows 10 provides URI schema for lauching Microsoft Egde from any browser. We dont use AcitveXObject at all.
Just include 'microsoft-edge' protocol handler before your URL.
How I resolved it
function openLinkInIE(url){
window.open("microsoft-edge:"+ url);
}
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f33616098%2flaunching-microsoft-edge-browser-from-a-microsoft-javascript-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Create an instance of the WSH Shell object instead:
var oShell = new ActiveXObject("WScript.Shell");
oShell.Run("cmd.exe /C start microsoft-edge:http://www.microsoft.com");
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
|
show 1 more comment
Create an instance of the WSH Shell object instead:
var oShell = new ActiveXObject("WScript.Shell");
oShell.Run("cmd.exe /C start microsoft-edge:http://www.microsoft.com");
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
|
show 1 more comment
Create an instance of the WSH Shell object instead:
var oShell = new ActiveXObject("WScript.Shell");
oShell.Run("cmd.exe /C start microsoft-edge:http://www.microsoft.com");
Create an instance of the WSH Shell object instead:
var oShell = new ActiveXObject("WScript.Shell");
oShell.Run("cmd.exe /C start microsoft-edge:http://www.microsoft.com");
edited Nov 10 '15 at 20:53
answered Nov 9 '15 at 22:30
Roman CanlasRoman Canlas
1,55131218
1,55131218
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
|
show 1 more comment
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
In my test, when it's executed in Windows, this code fails to open the Edge browser. It only opens a command prompt. Does it work for you? (I tested it by cutting and pasting into a test.js file and double clicking on it.)
– Castaa
Nov 10 '15 at 14:30
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
Update! Adding /C to the command string got it working. "cmd.exe /C start microsoft-edge:http:// www.microsoft.com" Now I still need to figure out how to get it open subsequent URLs in new tabs in the same Edge window. But this is a good start!
– Castaa
Nov 10 '15 at 14:40
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
updating my code. please dont forget to vote if it helped
– Roman Canlas
Nov 10 '15 at 20:53
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
is your landing page actually a website you maintain? if yes, you can add javascript code that will open up tabs once loaded
– Roman Canlas
Nov 10 '15 at 20:55
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
Actually using the Run() method multiple times with different URLs does in fact open new tabs in the same Edge browser window. I should have tested this and not assumed it would open multiple Edge browser windows. Your solution does work for me. I marked it as accepted. My only remaining issue is one of elegance. Which is when opening many URLs at once (40+ URLs in my case) via the script, it has to open and then close 40 temporary command prompt windows. Adding a 2nd parameter of 2 to Run() does at least minimize the cmd windows until they all eventually close on their own.
– Castaa
Nov 11 '15 at 9:00
|
show 1 more comment
I had faced a similar issue. Windows 10 provides URI schema for lauching Microsoft Egde from any browser. We dont use AcitveXObject at all.
Just include 'microsoft-edge' protocol handler before your URL.
How I resolved it
function openLinkInIE(url){
window.open("microsoft-edge:"+ url);
}
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
add a comment |
I had faced a similar issue. Windows 10 provides URI schema for lauching Microsoft Egde from any browser. We dont use AcitveXObject at all.
Just include 'microsoft-edge' protocol handler before your URL.
How I resolved it
function openLinkInIE(url){
window.open("microsoft-edge:"+ url);
}
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
add a comment |
I had faced a similar issue. Windows 10 provides URI schema for lauching Microsoft Egde from any browser. We dont use AcitveXObject at all.
Just include 'microsoft-edge' protocol handler before your URL.
How I resolved it
function openLinkInIE(url){
window.open("microsoft-edge:"+ url);
}
I had faced a similar issue. Windows 10 provides URI schema for lauching Microsoft Egde from any browser. We dont use AcitveXObject at all.
Just include 'microsoft-edge' protocol handler before your URL.
How I resolved it
function openLinkInIE(url){
window.open("microsoft-edge:"+ url);
}
answered Nov 16 '18 at 20:28
Murtaza HajiMurtaza Haji
4413
4413
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
add a comment |
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
Hi, what type is the variable "window"?
– Castaa
Nov 19 '18 at 20:03
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
its part of Web Api , check out this link for more info. developer.mozilla.org/en-US/docs/Web/API/Window/open @Castaa
– Murtaza Haji
Nov 19 '18 at 21:53
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f33616098%2flaunching-microsoft-edge-browser-from-a-microsoft-javascript-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Microsoft Edge no longer supports ActiveX blogs.windows.com/msedgedev/2015/05/06/… Where are you lanching the launch.js from?
– Roman Canlas
Nov 9 '15 at 20:18
Hi Roman. I'm executing the script .js file from my desktop. So the javescript code itself is being executed by Window's JavaScript Runtime and not Edge or IE.
– Castaa
Nov 9 '15 at 21:42
so it's like you're double clicking the .js file from the desktop or does it get executed on Windows startup?
– Roman Canlas
Nov 9 '15 at 21:48
I'm double clicking, yes.
– Castaa
Nov 9 '15 at 21:56