Amplificator / Show popup when receiving private message

// ==UserScript==
// @name         Show popup when receiving private message
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Show popup when receiving private message
// @author       Amplificator
// @license      MIT
// @match        https://*.hardwareonline.dk/*
// @grant        none
// ==/UserScript==
(function () {

  var rawElement = document.getElementById('header_inboxlink');
  var rawHtml = rawElement.firstChild.innerHTML;

  var firstChar = rawHtml.indexOf('(');
  var lastChar = rawHtml.indexOf(')');
  var messages = rawHtml.substring(firstChar + 1, lastChar)

  if (messages > 0) {
    alert('Du har en ny besked.');
  }

})();