So using the example in the SDK docs (below) doesn't work in the sense that it doesn't prevent the URL in the href from loading in the panel, and it doesn't console log anything. I'm not sure as to why it's not working the way it's specified in the SDK docs, unless it's outdated?

Code JavaScript:
   var myScript = "window.addEventListener('click', function(event) {" +
               "  var t =;" +
               "  if (t.nodeName == 'A')" +
               "    self.port.emit('click-link', t.toString());" +
               "}, false);"
var panel = require("sdk/panel").Panel({
  contentURL: "",
  contentScript: myScript
panel.port.on("click-link", function(url) {