DrewNaylor / DrewNaylor/DrewWebBrowser

Put in a button that removes ads from pages after the page loads on-demand.

Open
#13 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Visual Basic
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Description

From my OneNote page on this:
"In my Web Browser application, somehow put a button on the toolbar which acts as an advertisement hider using the bookmarklet code for hiding third-party iframes. Make it obvious that the button only hides ads after they are downloaded to make the page more readable and that the button is not an active adblocker (which does not allow advertisements to load.)"

JavaScript code I use provided by a page linked from a HowToGeek page:
``` javascript
javascript:(function(){function%20R(w){try{var%20d=w.document,j,i,t,T,N,b,r=1,C;for(j=0;t=["object","embed","applet","iframe"][j];++j){T=d.getElementsByTagName(t);for(i=T.length-1;(i+1)&&(N=T[i]);--i)if(j!=3||!R((C=N.contentWindow)?C:N.contentDocument.defaultView)){b=d.createElement("div");b.style.width=N.width;%20b.style.height=N.height;b.innerHTML="%3Cdel%3E"+(j==3?"third-party%20"+t:t)+"%3C/del%3E";N.parentNode.replaceChild(b,N);}}}catch(E){r=0}return%20r}R(self);var%20i,x;for(i=0;x=frames[i];++i)R(x)})()
```

The icon for this could be something like "-Ad" or maybe there could be a menuitem that's something like "BookXTensions" and the ad hider would be called "Remove ads" with a submenu for options and an "About" choice. The options I've thought of so far would be one and that's an option to run it automatically (not recommended) when pages load. It's not recommended because the ad removal code also removes elements like embedded videos from YouTube.

The tooltip text for the actual ad remover button would be something like "Remove ads from currently loaded page" and the automatically run option would have a tooltip like "Automatically remove ads as soon as pages load: Not recommended as this may cause problems with embedded videos or other wanted elements."

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.