What "magic" causes "cnn.com" when typed in IE11 to automatically launch Edge (Chromium)? - migration

I just noticed that when I typed in "cnn.com" into the IE11 address bar (Windows 10), that it automatically launched the website in Edge (Chromium) instead, then rendered this bar at the top of the site in Edge.
(it also looked like if this was the only tab in IE, it auto closed IE)
I like this new behaviour to help migrate users over from IE, but sadly I could not detect how this is done code wise by CNN.
I looked in Fiddler, scanned the HTTP Headers, and the meta tags on the site... e.g.
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
and the IE only comment tags:
<!--[if lte IE 9]><meta http-equiv="refresh" content="1;url=/2.250.0/static/unsupp.html" /><![endif]-->
but I don't see anything specific that seems to be triggering this? I'd certainly like to entertain applying similar behaviour to some sites/apps that I work on.
FWIW, it also triggers (if you try it enough times) this message to remain in IE11:
https://support.microsoft.com/en-us/office/the-website-you-were-trying-to-reach-doesn-t-work-with-internet-explorer-8f5fc675-cd47-414c-9535-12821ddfc554?ui=en-us&rs=en-us&ad=us

Edge 87 installs a browser helper object called IEToEdgeBHO that performs this redirection based on a pre-provisioned site list (https://edge.microsoft.com/neededge/v1)
Inside Edge, see edge://settings/?search=Internet%20Explorer for the setting that enables/disables this feature.

Related

What is the working of Browser and Page in QTP/UFT?

I always get a doubt that:
What exactly is the difference between the working of Browser and Page.
I know it is a hierarchy and that stuff, but how does the tool differentiates the browser and page and what is use of having both of them.
For example, if I use descriptive programming, and type:
Browser("title:=Google").Page("title:=Google").something
irrespective of the Browser (which may be IE / Chrome / Firefox) it will use the browser with the title = Google. And same is for the page.
Please elaborate. I am confused.
There's an explanation of what Browser and Page are supposed to represent on HP's blog.
In short Page has no semantic meaning, it is just used in order to organize the object repository more cleanly (so that you don't get hundreds of objects under one Browser object). If you're using descriptive programming (as I see from your example) then the Page has no meaning (since every browser has only one Page) and having a description for the page adds nothing.
I would replace the line with:
Browser("title:=Google").Page("title:=.*").something
Or
Browser("title:=Google").Page("micclass:=Page").something

How to trigger 'quirks mode' is IE 10

Background:
The issue I'm facing is actually related to printing a webpage. The page is (almost) valid HTML 5 (with a few <table>s with cellpadding, and some <img>s without alts etc). I have a print stylesheet that prints nicely in all the browsers we are supposed to support (latest Chrome, FF and IE) except IE 10.
We have specific requirements about the print layout (which is significantly different from the web layout). We cannot use a separate page designed for printing as most of the page's content is generated using lots of inputs from the user within JavaScript. One of our print layout requirements is that the printout be on exactly 3 pages with specific parts on specific pages. Its working in all browsers we are supporting except IE 10.
In IE 10, the print out is 6 pages (3 in all others) working with the standard "Shrink To Fit" setting. Now I could go around writing a separate print stylesheet for IE 10 but that just seems like too much work.
While playing around with the IE 10 dev tools, I noticed that if I select "Quirks" "Document Mode" and then print, it fits nicely in 3 pages. So the simplest solution to my printing problem seems to be to somehow trigger quirks mode in IE 10 (but not in IE 11 where it already works).
The actual question:
So the question is, how do I trigger quirks mode in IE 10 without triggering it in IE > 10. This MSDN page says
If a page doesn't contain a <!DOCTYPE> directive, Internet Explorer displays the page in quirks mode by default.
So I tried doing the following with my doctype declaration:
<!--[if gt IE 10]>
<!DOCTYPE html>
<![endif]-->
That didn't trigger quriks mode in IE 10 for me. What will?
You can use a meta tag to controll how the page should render:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10">
This will cause the page to be rendered in IE10 mode if a DOCTYPE is present otherwise it will fallback to quirksmode. You can check this link to msdn to see the different X-UA-Compatible modes that can be used.
So if you want IE10 to always render the page in quirksmode you ought to be able to force it using:
<meta http-equiv="X-UA-Compatible" content="IE=5">

WebKit losing parameters in URLs with skip links

We have some generated pages whose URLs contain parameters, like http://example.com/page.do?param1=hello. These pages contain named anchors inside, <a name="here">like this</a>. And there are corresponding links that reference the named anchors, like this. Most folks today call these "skip links".
Clicking a skip link should result in the browser creating and following a URL that matches the original one, with the named anchor tacked on at the end: http://example.com/page.do?param1=hello#here
On Firefox and IE, this works fine. On Chrome, Safari and other WebKit-based browsers, the parameters are lost, leading to http://example.com/page.do?#here which is invalid for our site, and just causes a 404 error.
Interestingly, if you manually put the full link in the location bar and press Enter, it behaves properly.
I've googled around a while and seen a lot of discussion about WebKit having problems with skip links, but none of them match the situation here where it's losing parameters.
Is this loss of parameters a known bug? Has anyone seen a workaround?
I encountered the same issue. From what I can say this is related to the usage of a meta tag like this: <base href="http://example.com" />. Once it is set my links point to example.com#foo instead of example.com?foo=bar#foo.
Knowing that I found this question. So the anchor tag behavior is a known thing:
Is it recommended to use the <base> html tag?
Since I can't remove the base tag I'll try to handle this with JavaScript.

Bring Safari to front

I'd like to bring Safari to the front (switch to) but without using a URL, instead I'd like to see the "pages" view so the user can pick an already loaded page. Is this possible?
We open links in Safari and if the user returns to the app and selects the link again, I'd rather let them pick which Safari page to browse instead of opening a new one. I know that if the same URL is called it will open the correct page but the user may have navigated within the original site so the url no longer matches.
Thanks,
Rick
I don't think that its possible, i would use a UIWebView inside your app in order to get that experience you want, you can find the UIWebView apple docs here (http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html) and also the equivalence of c# methods here (http://tirania.org/tmp/rosetta.html) hope this helps
Alex
Your app doesn’t get control of Safari’s UI. You might, however, be able to design your site so that it handles navigation via Javascript—AJAX and whatnot—so that the actual page URL doesn't change, and thus so that the page, re-opened from your app, brings up the existing Safari page. Of course that introduces further problems with your pages no longer being bookmarkable, but you might find that an acceptable tradeoff.

Is there a workaround to Safari's/Opera's bug that you can't tab through hyperlinks?

In IE, Firefox, Chrome and most Windows-based interfaces that I've used, the Tab key can be used to navigate from one form field or hyperlink to the next (e.g. "actionable" items) (note: I have not tested on other Operating Systems)
However Safari and Opera skip all hyperlinks in a web page when tabbing. IMHO its a usability bug but I digress.
Is there a workaround/hack to make Safari and/or Opera navigate through these links?
I've noticed that Opera will accept the tabindex attribute if set e.g. tabindex="0" thus maintaining the links "index" within the flow of the DOM on the page... but Safari does not want to accept this.
For those interested, this bit of jQuery will make all the hyperlinks tabbable.
//Make links 'tab-able' in Opera
$(document).ready(function(){
if($.browser.opera){
$('a[href]').attr('tabindex', 0);
}
});
...and although this seems to work for Opera... is there a better workaround?
In Safari, it's not a bug, it's an optional feature. On the Mac, tab selects objects other than links, Option+Tab select all objects. You can swap the behavior of these shortcuts in Preferences->Advanced. Then tab will behave like in other browsers.
On Windows, Option+Tab is not available. By default tab selects objects other than links , but there is an option in Preferences->Advanced that makes tab select all objects. Then tab will behave like in other browsers.
You should probably not try to interfere with this, as you would interfere with the user's preferences.
Actually this is a bug, according to the spec (see below) anchors (<a> elements) are supposed to accept the tabindex property, and a tabindex of 0 should make it focusable in the order the elements appear in the document.
http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex
Opera traditionally thought this was a feature, not a bug (we had and have other key shortcuts for navigating links, when you know those you might find it useful to have distinct navigation for links and form elements - tried shift+arrow spatial navigation yet?). To some people it still is a feature. True anecdote: once upon a time an internal build made links tab'able by accident and this caused so many bug reports and complaints it was promptly reversed. (As far as I remember, also because the tabbing was buggy in other ways).
We know, however, that tabbing to links is something most users expect and that we should implement a pref for this like Safari has. In the meantime, you can add something like your JS fix above to a user javascript to have tab navigation to links on all websites out there.