Anders Behring Breivik's world view seems to have been shaped by online fantasy games and the anti-Islamist blogosphere – a recipe for national fragmentation.

There is a reason why the Norwegian police have not been overly concerned with rightwing extremism in recent years. It is plainly not very visible. An estimated 40 Norwegians currently belong to self-proclaimed extreme rightwing groups.

However, anyone familiar with the darker waters of the blogosphere would for years have been aware of the existence of a vibrant cyberscene characterised by unmitigated hatred of the new Europe, aggressive denunciations of the "corrupted, multiculturalist power elites" and pejorative generalisations about immigrants, targeting Muslims in particular.

Contributors to these websites, blogs and chat groups cannot merely be labelled "rightwing". One member of the Norwegian "Forum Against Islamisation" was also a member of the Socialist Left party. Others see themselves as the true heirs of social democratic values, or as the last carriers of the torch of the Enlightenment. Many talk about gender equality, some about social injustices and class. Others hold more conventional rightwing views, ranging from downright racism to paranoid conspiracy theories about Muslims plotting to take political control of western Europe. Some are online daily; others drop in once a month. They constitute loose networks and cannot easily be counted.

What the denizens of this blogosphere have in common is, first and foremost, a resentment of the defenders of diversity. These "elite" are often described as "traitors", "sellouts" or just "naive multiculturalists". They also share the conviction that Islam is incompatible with the democratic values of the west. This view is problematic in a country where the Muslim population is over 150,000 and growing. Nobody knows how widespread such views are, but they can no longer be written off as harmless.

The fact that Breivik was Made in Norway, a homegrown terrorist with a hairdo and an appearance suggesting the west end of Oslo, and not a bearded foreign import, should lead not only to a closer examination of these networks, but also to a calm, but critical reflection over the Norwegian self-identity itself. It would come as a relief to many if the leadership of the country were to state unequivocally that religion and skin colour were irrelevant to membership in the Norwegian nation. King Haakon VII, who reigned from 1905 to 1957, famously said that he was "the king of the communists, too". King Harald V could hardly do better, in the current situation, than pointing out that he is "the king of Norwegian Muslims, Sikhs, Jews and Hindus, too". Perhaps it goes without saying, yet a statement of this kind would cleanse the air in a situation where extreme xenophobia and religious prejudice have been the source of inspiration for unspeakably atrocious acts.

Every country needs some degree of cohesion. Just how much is a legitimate matter of dispute. Some believe that cultural pluralism is a recipe for fragmentation and the loss of trust. This may be the case, but not necessarily. So long as common institutions function impartially – education, housing, work etc – a society can live well with considerable diversity. However, the moment we cease to speak to each other, something serious is under way. This is exactly what happened with Breivik and many of his co-believers: they developed a parallel reality on the internet.

The role of the internet in fragmenting the public sphere has been the subject of some scholarly and journalistic interest, most recently in Eli Pariser's excellent The Filter Bubble, which shows how Google, Facebook and other major actors filter our web searches, updates etc according to our user profiles and previous cyberhistories. So if I am an environmentalist typing "climate change" into Google, I get a different set of results from you, if you are an oil executive. The filter bubble operates on Amazon by giving personal recommendations; in its more insidious ways, it tailors our web searches to confirm our pre-existing world view without us noticing. Eventually, we may drift apart and end up living in different worlds.

Breivik must willingly have allowed himself to be brainwashed by Islamophobic and extreme rightwing websites. However, had he instead been forced to receive his information through a broadsheet newspaper, where not all the stories dealt with Europe's loss of confidence and the rise of militant Islam, it is conceivable that his world would have looked slightly different. Perhaps one lesson from this weekend of shock and disbelief may be that cultural pluralism is not necessarily a threat to national cohesion, but that the tunnel vision resulting from selective perusal of the internet is.