User:FrViPofm/monobook.js

From OpenStreetMap Wiki
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
addOnloadHook(function () {
  var target = "hidenIFrame";
  var frame = document.body.appendChild(document.createElement("iframe"));
  frame.setAttribute("style","display:none");
  frame.setAttribute("id",target);
  frame.setAttribute("name",target);
  var links0 = document.getElementById('bodyContent');
  var links = document.getElementById('bodyContent').getElementsByTagName('a');
  for(var a in links) {
    if(links[a].href && links[a].host == 'localhost:8111') {
      var h = links[a].host;
      links[a].setAttribute("target",target);
    }
  }
})