UserJS to Hide Filtered Elements
Wednesday, 26. October 2005, 16:32:08
Do you use Opera's filter.ini feature, or a HOSTS file to block certain content? Do you hate to see web pages rendered with large amounts of unused white-space when your filtering works? If so, then these pair of scripts may help.
As mentioned in my previous post, I use Opera's filter.ini feature. Because of this, Opera effectively blocks many third-party images, iframes, and JavaScripts. Effectively, this often results in large rectangular regions of unused white-space on websites that host advertisements. To compensate for this, I have developed a pair of User JS files that hide non-loaded images and iframes...
Download/view imgload.js
-and-
Download/view iframeload.js
As an added bonus to webpage readability, these scripts can also improve mouse gesture usability -- which don't work so well over blank/filtered-out inline frame elements.
Enjoy.
Update 2009/12/07 - Changed f.location to f.src in iframeload.js
As mentioned in my previous post, I use Opera's filter.ini feature. Because of this, Opera effectively blocks many third-party images, iframes, and JavaScripts. Effectively, this often results in large rectangular regions of unused white-space on websites that host advertisements. To compensate for this, I have developed a pair of User JS files that hide non-loaded images and iframes...
Download/view imgload.js
document.addEventListener("load",
function(e) {
var imgs = document.images;
for (var i = 0, o; o = imgs[ i ]; i++) {
if (!o.complete) o.style.display = "none";
}
}, false);
-and-
Download/view iframeload.js
document.addEventListener("load",
function(e) {
var ifrms = document.getElementsByTagName("iframe");
for (var i = 0, f; f = ifrms[ i ]; i++) {
// if (!f.location) f.style.display = "none"; // Version 1.0
if (!f.src) f.style.display = "none"; // Version 1.1
}
}, false);
As an added bonus to webpage readability, these scripts can also improve mouse gesture usability -- which don't work so well over blank/filtered-out inline frame elements.
Enjoy.
Update 2009/12/07 - Changed f.location to f.src in iframeload.js

dapxin # 3. March 2009, 06:33
Lee Harvey # 3. March 2009, 13:20
Of course, if you visit a page that contains a ton of non-loadable images, then you're going to wait a very long time for the document.load event to kick-in (after the page has loaded) anyhow. Meaning: These scripts don't run until /after/ the page has loaded. They then filter-out (hide) any non-displayed images and silly inline frames with no location specified.
dapxin # 3. March 2009, 18:05
J # 27. April 2009, 16:27
Brent B. Powers # 21. October 2009, 19:29
Unfrotunately, my java script fu is weak, at best, but I'll let you know if I find anything else...
dapxin # 30. October 2009, 23:47
e.g http://tinypaste.com/261fe14
How can this be stopped?
dapxin # 18. November 2009, 10:13
dapxin # 18. November 2009, 10:24
// @exclude http://*tinypaste.com/*
To the header files. nice.
Lee Harvey # 7. December 2009, 13:32