Post Reply 
url cleaner for privoxy
Feb. 02, 2016, 09:49 PM (This post was last modified: Feb. 04, 2016 04:04 PM by Faxopita.)
Post: #2
RE: url cleaner for privoxy
Instead, can you apply it this way…
Code:
FILTER: urlcleaner

s@(^[^;]*?(?:<head[^>]*?>|<body[^>]*?>|<script[^>]*?>[^>]*?</script>))@<script>\n\
(function () {\n\
    'use strict';\n\
    document.addEventListener('DOMContentLoaded', function (e) {\n\
    var thisLink, allLinks,linkArray;\n\
allLinks = document.getElementsByTagName('a');\n\
for (var j = 0; j < allLinks.length; j++) {\n\
    thisLink = allLinks[j];\n\
    if(thisLink.href.indexOf('http') !=-1)\n\
    {\n\
    linkArray=thisLink.href.split('http');\n\
thisLink.href=decodeURIComponent('http'+linkArray[linkArray.length-1]);\n\
thisLink.href=thisLink.href.replace(/&amp;/g,'&');\n\
    }\n\
}\n\
    });\n\
})()\n\
</script>\n$1@i

Based on this this template and getting first the DOM ready; read here.
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to Faxopita for this post:
cattleyavns
Post Reply 


Messages In This Thread
url cleaner for privoxy - kik0s - Jan. 31, 2016, 09:31 PM
RE: url cleaner for privoxy - Faxopita - Feb. 02, 2016 09:49 PM
RE: url cleaner for privoxy - Faxopita - Feb. 04, 2016, 11:55 AM

Forum Jump: