Tired of ads on neo? no ? me neither because we all use adblock. But what you may not know is that adblock blocks only the server the ads are hosted on , there is still some javascript neo injects into each page to refresh there ads. Constant javascript running in every neo tab you have open can be a resource hog so i made a block ad script for neo:
This script :
1.Blocks top ads
2.Blocks right hand side ads
Im also running my remove "like us on facebook" script at same time here just to make things even cleaner.
Before:
After:
Oh look it works on mobile too!
before:
After:
Heres the script , simple stuff:
Code:
--Although ads can be blocked in the url blocker for neo I prefer a script--This is because they inject javascript into the page to make ads refresh
--Url blocking would still work in this case but we might aswell remove
--there scripts too increase performance
<trigger>hostname|www.neopets.com</trigger>
function removetopad(pagehtml)
--Removes top banner ads entire table , and script inserted with it and the "advertisement" tag that neo puts next to it by deleting its entire <tr> tag
pos1 = find(pagehtml,"adslug-opa-l.png"); --Always before neopets top page ads
rethtml = "";
if pos1 > 1 then --Ad found
pos2 = findreversed(pagehtml,"<tr>",pos1);
pos3 = find(pagehtml,"</tr>",pos2);
rethtml = trimstring(pagehtml,pos2,pos3); --remove the tr tags
end
return rethtml;
end
function removerightad(pagehtml)
pos1 = find(pagehtml,"rubiconAdWrapper"); --Always before rightpage ads
rethtml = "";
if pos1 > 1 then --Ad found
pos2 = findreversed(pagehtml,"<div",pos1);
pos3 = find(pagehtml,"</div>",pos2);
rethtml = trimstring(pagehtml,pos2,pos3); --remove the tr tags
end
return rethtml;
end
pagehtml = getpagehtml(); --Gets Current page html
filteredhtml = removetopad(pagehtml); --See if we need to filter the html of the page (returns a empty string if not)
if filteredhtml ~= "" then
pagehtml = filteredhtml; -- a filter was added
end
filteredhtml = removerightad(pagehtml); --See if we need to filter the html of the page (returns a empty string if not)
if filteredhtml ~= "" then
pagehtml = filteredhtml; -- a filter was added
end
return pagehtml;
p.s idc about that account