diff --git a/js/postMessage-debugger.js b/js/postMessage-debugger.js index 379126a..54f223b 100644 --- a/js/postMessage-debugger.js +++ b/js/postMessage-debugger.js @@ -1,9 +1,14 @@ -console.debug("postMessageDebugger activated"); +function hashCode(s){ + return s.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0); +} + +var id = "[" + this.hashCode(window.location.href) + "]"; +console.debug(id + " postMessageDebugger activated"); addEventListener("message", function(event) { console.debug( - "postMessage received by '" + - document.title + - "' from '" + + "postMessage received by " + + id + + " from '" + event.origin + "' with data:", event.data