Coding for Microsoft browsers like Internet Explorer and Edge

Having been doing battles with things like Internet Explorer 4 (yes, I’m that old), it seems to me like Microsoft have really gotten themselves into a bind when it comes to Edge.

With a user-agent string like this:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299

It’s no wonder Microsoft seems to be suffering from a split personality when it comes to its browser(s).

Once and for all Microsoft, please just join either of the Chrome/Chromimum/Opera/Firefox projects. Please?

To CDN or not to CDN, are Content Distribution Networks always good?

CDN is supposed to be fast, right? CDN is supposed to off-load your servers, right? CDN is supposed to be geographically boosted for the visitor, right? But when you have 3-6 *different* CDN sources in your various scripts/include list, and they’re all HTTPS (as they should be), the browser will perform a TLS/SSL handshake 3-6 times when it loads your website. This is by no means fast. In fact, if you’re tweaking your website for below-one-second-load-times, you may be barking up the wrong tree.

If you instead place those resources locally, on your own server secured with HTTPS, you get one session handshake. And since most “clever” sites tell the browser(s) to cache static resources like .js, images, and so on, I’m not so sure I think CDN is the way to go for many websites if you use different CDN resources on the same website, that is.

But hey, what do I know, I don’t run the CDN companies 🙂

Life free of digital footprints should be a human right

The feeling that somehow, somewhere, someone connected the dots between your recent live chat session with your online florist and your Facebook account, or Google, or some other service or site that makes billions of dollars on selling your personal Internet usage data. That feeling.

Using a browser plug-in that detects known so-called trackers makes for some rather disturbing revelations. It’s not just about “ad blockers”, or “pop-up blockers”, or disabling support for “third-party cookies”. Many sites stop working cold when you block stuff that has no business being there in the first place.

When your online florist decides to add live chat support to their website they are putting their own business and your integrity at risk. And in many cases they are not even aware of it, nor should they have to be.

So the supplier of the live chat support drops in 10-12 known trackers, including Google, Facebook, Now Interact, and many many more. The live chat function doesn’t work if you have third-party cookies disabled in your browser. In other words, they require you to enable the possibility for sites to indirectly add tracking data to your browser, and you don’t even have to visit those sites.

Your online florist is paying the live chat supplier. The live chat supplier gets money from your florist, from advertisers, and from “web analytics” companies for including a number of trackers in their services. The advertisers and “web analytics” companies then sell advertising slots, perhaps to your online florist (can you say catch-22 ..)

What your online florist may fail to understand is that you as their customer cannot use their live chat support if you block things. So for you, the customer, and your online florist, it’s a lose-lose situation. For the live chat supplier and the advertising and tracking companies, it’s win-win. And a few months down the road, your friends on Facebook will receive suggestions about buying flowers online because you happened to use a live. And the suggested place of purchase will not be your online florist.

The point here is not that it’s impossible to prevent tracking. The point is that many things on the Internet stop working for “common people” if you do attempt to prevent tracking.

(And why would you want to use a live chat function in the first place? Because many companies are so bad at responding to customer support e-mails that you will grow old and senile waiting for a response. By the time it arrives, you won’t remember why you asked the questions in the first place.)

And the biggest problem of all? Nobody seems to care until it’s way too late. And by that time, you will realize that you have been tracked for the past 15-20 years, your children have been tracked since they were born and given their first Gmail account, and so on … maybe your biggest fear should not be giving out your credit card details online or what the NSA knows about your sexual preferences 😉

You may now resume power saving mode … Zzz zzzZzzz 

Making SimpleXML truly simple using JSON in PHP

So using SimpleXML in PHP is possibly one of the worst hells of typecasting and data extraction procedures one can encounter, or close to it 🙂 But more the point, you don’t need to walk down that road alone, enter JSON.

In the simplest of ways, this will typically get you something useful:

    $pvar = json_decode ($xml);


(Where $xml is a SimpleXML-type object) This returns a “slightly easier to manage” PHP array.

If you want an associative array, do this:

    $pvar = json_decode ($xml, true);


To get it back to JSON, you simply use:

    $json = json_encode ($pvar).


You may need to handle XML data, but you don’t necessarily need to work with it in XML form inside your application. The above examples may not work fully for you if you have to deal with “foreign” files or clean the input data prior to conversion, but you get the idea.

This is, obviously, obvious to many. It’s a lifesaver for others 🙂


Removing ClustrMaps


As of today, this site is no longer using ClustrMaps. There’s no particular reason for removing it. I just don’t use any information from ClustrMaps, so I don’t see the point in having it activated 🙂 For the functionality it provides, it has always worked well for me. If you need the information/statistics provided by ClustrMaps, I highly recommend it.

Clustrmaps: ClustrMaps

Roligare profilbilder med Face Your Manga

MangatarFler webbsajter gör det möjligt att man utöver sitt namn, användarnamn eller signatur också identifierar sig med en s k ”avatar” eller ”gravatar”. En del webbapplikationer har haft stöd för detta länge (t ex många forumtjänster). När Facebook och liknande nu blivit omåttligt populärt så kan Face Your Manga kanske vara ett roligt sätt att skapa sin egen profilbild. Fantasin har inga gränser, eller nåt 🙂

Skapa din egen Mangatar på