Force open EDGE over Internet Explorer? - javascript

If you try to open stackoverflow website using Internet Explorer, somehow it closes the tab and opens microsoft edge + browse to stackoverflow website?!
How does stackoverflow accomplish this?

StackOverflow
This should open a tab in Edge, but I'm unsure if it'll prioritize Edge over IE.
From what I remember as well, there should be a way to check in JavaScript if the user is using a Windows-related device, and you can then add the 'microsoft-edge:' portion to the href.

Related

window.focus() does not work for existing tabs in ALL IOS browsers

I'm trying to create a "re-launch" button that should bring the user to an existing opened tab. So far, this is how it's implemented:
Using window.open() initially to create the tab and focusing to that tab using window.focus().
The relaunch button should basically call window.focus() and redirect to that tab.
This has been asked in $window.focus() doesn't work on existing tabs in iOS Safari but I'd like to get a more general overview on this question. I've looked everywhere but I couldn't find any lead to this question.
Apparently, it works in android browsers but I can't get it to work in ios browsers (safari, chrome). Does anyone have any clue about this issue?
This seems to be a bug in iOS browsers. As a workaround you may replace
focus() by a sequence of close() and open(...).

How to open to an existing tab in safari with an html 'a' link?

From Safari I can launch another app with:
Open WebBrowserApp
But I can't seem to return to Safari with:
Return to Safari
If possible I'd like to return to the tab I came from.
Thanks!!!
The problem is that.... You can not open safari using
Safari://
Well... you can not open safari on iOS using another browser..... so that means you cannot achieve what you are looking for... even in iOS 13 and I don’t think Apple is gonna implement that anytime soon....
So you can use any other browser like:
Firefox: Return to Firefox
Google Chrome: <a href=“GoogleChrome://“>Return To Chrome</a>
And I am sure there are many other great alternatives.... Goodluck!

The IE doesn't show address bar for popup

I am on the parent page from which I use javascript in jsp, to open a popup and I used the method window.open("url","windowName"," width,height,locastionx, locationy") to get a popup. Everything works fine in all browsers(like Mozilla, Chrome etc) except that the Popup doesn't show the url or address bar in Internet Explorer 10.
I am attaching the screenshots for reference
The following screenshot is a popup from IE
The following is a screenshot of popup from Mozilla
Is there a way in which the window.open method which will show address bar in the IE?
Thanks for helping
I did read in few online blogs that the behaviour of the popup is different with the IE7 or above than in the Mozilla or the Chrome browsers.
I've been busting my head around this problem a couple of days, I've browsed a lot of sites to find the answer, finally I discovered that IE when you run your code in a local environment it hides the URL bar, but when I run it in a Test/Prod server the address is shown (not showing the URL address is clearly a security flaw), this just happens only in IE, which is annoying, for FireFox and Chrome work as intended, and it's kind of a headache if you need to test because it may seem like an error or bug.
Here are the links that should make the things clearer:
Complete cross-browser window.open() documentation -> here
MSDN open method notes ->
here
Server Fault question about IE trust policies related to the URL bar -> here

window.close() is not working in FF

We are using window.close() to close the current browser tab. It works for IE, Chrome, Safari, but not for FF.
We tried lot of solutions provided on Internet, but it seems they are not working.
window.open('','_parent','');
window.close();
Actually due to security reason and user experience aspects you can
now can't cause the browser to be closed[Completely], only popup
windows can be closed or the one parent to a script.
check the following mozilla support forum
possible duplicate of SO Question

JavaScript for iPhone to open in Safari from non-default iOS browser

"googlechrome://www.lego.com" opened in mobile Safari will switch to Google Chrome iOS app to open the URL. This allows for scriptlets like the one below, which allows you to open the current page in Google Chrome iOS app, switching from mobile Safari:
(function()%7Bif(document.location.href.indexOf('http')===0)document.location.href=document.location.href.replace(/%5Ehttp/,'googlechrome');%7D)();
My question is, can the reverse be done? I tried "safari://www.lego.com", and it is simply an invalid URL. Can you make a scriptlet which switches from Google Chrome to mobile Safari to open the current page.
The answer is yes. Courtesy or MacStories (http://www.macstories.net/tutorials/chrome-for-ios-send-a-webpage-back-to-safari-via-bookmarklet/), I found this code:
window.location='googlechrome-x-callback://x-callback-url/open/?url='+encodeURIComponent(location.href)+'&x-source=Safari&x-success='+encodeURIComponent(location.href);
Execute that code, go to your homescreen, reopen Chrome, and there's a magical back button to go back to Safari. This may not be exactly what you want, but it works... Kink of.
Good luck!
Update:
Here's a screenshot:
Link (Sorry, I don't have enough reputation to put it right in the post): http://i.stack.imgur.com/OR175.jpg
Update:
It seems that the functionality to do this has broken. Thank you!

Categories