Jump to content
IGNORED

attn: web devs


Recommended Posts

hello,

 

i just had an idea for a thing, namely an inverted adblock browser extension which filters out anything which is not on a adblock blacklist.

 

i.e. you get to see ads only.

 

please note that i do not ask your opinion on why this is a stupid idea. okay? unless it is a lol opinion then it's okay.

 

now, i do know programmering, but haven't ever done anything related to website tinkering.

 

so the question is, what would be the basic steps to implement a content filter in js? it shouldn't block entire sites, but needs to get rid of .html content which is not on the ad-provider whitelist....

Edited by Guest
Link to comment
https://forum.watmm.com/topic/79745-attn-web-devs/
Share on other sites

It's only a theory but could you just use adblock and cut the filter list from the blacklist and paste into the whitelist ?

I haven't eaten a Wagon Wheel since 07/11/07... ilovecubus.co.uk - 25ml of mp3 taken twice daily.

Link to comment
https://forum.watmm.com/topic/79745-attn-web-devs/#findComment-2036917
Share on other sites

  On 7/16/2013 at 12:34 PM, th555 said:

It would be funny to make a site that replaces all images and coloured rectangles with ads, but keeps the layout intact.

 

yea i'm wondering, that should actually be possible with an extension, e.g. wouldn't this be quite simple with images? like:

 

foreach image request

replace image url with random ad image url instead.

 

as i said, i don't have web dev experience, but isn't all web development basically copy paste from somewhere?

Link to comment
https://forum.watmm.com/topic/79745-attn-web-devs/#findComment-2036928
Share on other sites

this is, I think, what adblock uses to match the document against the set of elements to be filtered:

var results = document.querySelectorAll(selector);

it goes on to destroy all elements which are contained in 'results'.

 

do you know if there's a way to invert this, i.e. give me all elements which do NOT match the selector?

Link to comment
https://forum.watmm.com/topic/79745-attn-web-devs/#findComment-2036948
Share on other sites

I could be wrong buy I think the '==' is used to assess equality/matches (with the opposite being '!=') wheras the single equals just means it assigns the result on the right to the variable on the left.

I haven't eaten a Wagon Wheel since 07/11/07... ilovecubus.co.uk - 25ml of mp3 taken twice daily.

Link to comment
https://forum.watmm.com/topic/79745-attn-web-devs/#findComment-2036951
Share on other sites

You probably don't want to destroy elements because that will just collapse the page. It wont be as simple as flipping a boolean because you might have an element containing an ad you want to show. If you hide or destroy the outer element you'll just hide everything contained inside. Adblock doesn't need to preserve content within a blocked element. I'd say your best bet would be to add a blank layer over the page, extract the elements and their position you want to show and display them on top of your blank layer. I would use the element matching code of adblock so you can use their filter lists to extract the DOM elements you want to keep.

Edited by Ego
Link to comment
https://forum.watmm.com/topic/79745-attn-web-devs/#findComment-2036979
Share on other sites

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   1 Member

×
×