-
Notifications
You must be signed in to change notification settings - Fork 8
CTM core experience running when on enhanced experience #83
Comments
I've been testing IE's against o-tracking.
So it seems to be only IE9. |
@alicebartlett Do you know what GDS do for this kind of thing? |
I studiously avoided all the tracking js for GOV.UK, but I had a look at the code (https://github.com/alphagov/govuk_frontend_toolkit/tree/master/javascripts/govuk/analytics) and asked @edds. We didn't have a non-javascript solution for tracking and we used google analytics + some custom wrapping for the JS based tracking |
So i've thrown together a simple test case and tested it on browerstack and ie9 doesn't download the image for the following code:
As long as the CSS to set
is being loaded in the head, this should work so I'm pretty puzzled now. |
@alicebartlett - thanks for looking into it - sorry for late reply, I've been out of office. It would be great to look at it together, maybe tomorrow (Thursday)? We think it's happening in IE11 now too, as well as IE9. |
Perhaps drop support for non-javascript tracking and implement a basic non-ctm version of o-tracking which would work on IE8 etc. I think this is simpler. |
Fixed in next by using the following instead of the recommended non-ctm fallback
Mark has implemented something similar on FT.com It's annoying having to specify the url twice, although it might be possible to read textContent of the noscript to get at it in the non-ctm code. Do we want to update the docs to recommend something like this instead of the bg image @markstephens @alicebartlett |
I think yes, as the CSS version is junk.
We've investigated reading the contents of noscript before, from memory, I think it wasn't reliable. Dan Searle (now left FT) looked into it a lot. |
It'd be really nice if ctm, became a standard, so you could properly disable javascript for a page if you wanted to. Something like |
See https://discourse.wicg.io/t/disable-scripts-api-standardised-cut-the-mustard-failure-handling/1277 where Rhys raised this on WICG. I came up with the idea of using CSP, and it occured to me that this would already work today, in browsers that support CSP (so this is a bit academic as there probably aren't any that support CSP but don't support enough JS to be considered primary experience) Anyway, you could do this: if (!cutsTheMustard) {
document.cookie = 'CTM=core';
window.reload();
} And then in Fastly, some VCL that matches on this: if (req.http.Cookie ~ /CTM=core/) {
resp.http.Content-Security-Policy = "script-src 'none'";
} When the page reloaded, it would not run any JS. However, obviously in browsers that fail CTM and don't support CSP, you would get an endless reload loop. And this doesn't help make noscript work on those browsers. |
Oooh clever. But won't that On Saturday, 30 January 2016, Andrew Betts notifications@github.com wrote:
This email was sent by a company owned by Financial Times Group Limited |
In the console, yes. Don't really see that as an issue.
Yes, the presence of a CSP header disables all inline scripts by default.
Fair enough
True, but if the CTM test is in the first packet of the first response it wouldn't make a massive perf impact. Anyway, it's not practical for us because CSP is not supported in old browsers - and I suppose the whole principle that we're talking about here is counter to the principle of progressive enhancement. We should be turning script ON, not turning it OFF. And ultimately the thing that kicked this off was a lack of an effective |
This has been fixed in the Origami documentation for how to implement a cuts-the-mustard test and how to load images only in browsers which do not pass the cuts-the-mustard test |
We have an issue with the core experience - in certain browsers - its loading the fallback image when the page is in enhanced mode.
The core experience looks like this:
I've seen this image loading in enhanced mode using ie9, but membership have reported it in IE8 too.
Apparently this quirk won't have ever have worked for IE: http://justinmarsan.com/hidden-elements-and-http-requests/
That chap's test page confirms it's failing in my IE9 too.
Anyone got any ideas for a solution?
cc @AlbertoElias @triblondon
The text was updated successfully, but these errors were encountered: