SHARE
TWEET

Quick solution to fix last Opera UXSS vuln

aels Oct 11th, 2012 150 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (window.opera) {
  2.         var nodes = document.getElementsByTagName("a"), i = nodes.length;
  3.         var regExp = new RegExp("//" + location.host + "($|/)");
  4.         while(i--){
  5.                 var href = nodes[i].href;
  6.                 var isLocal = (href.substring(0,4) === "http") ? regExp.test(href) : true;
  7.                 if (!isLocal) nodes[i].href = "data:application/internet-shortcut,[INTERNETSHORTCUT]%0D%0AURL="+nodes[i].href;
  8.         }
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top