From fc4e183c413e4bd64dc0f13b9cad4fcf1dd68dd4 Mon Sep 17 00:00:00 2001
From: Jan Moesen
Date: Mon, 1 Feb 2016 23:39:22 +0100
Subject: [PATCH] Kill overlays: kill known overlays (of *any* size)
---
bookmarks.html | 4 ++--
content/kill-overlays.js | 17 ++++++++++++++---
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/bookmarks.html b/bookmarks.html
index 6c90d84..08f2fa3 100644
--- a/bookmarks.html
+++ b/bookmarks.html
@@ -43,7 +43,7 @@ Bookmarks Menu
See COPYING for licence details. Or "license details", if you are so inclined.
-These bookmarks were exported on Thu, 2016/01/21 09:12:32 +0100.
+These bookmarks were exported on Mon, 2016/02/01 23:39:26 +0100.
Content
Tweak the page's content.
@@ -51,7 +51,7 @@ Bookmarks Menu
- Load full images
Load the full-size versions of resized images based on their "src"
attribute, or their containing link's "href" attribute.
- - Kill overlays
+
- Kill overlays
Get rid of common overlays, such as full-page ads.
Development
diff --git a/content/kill-overlays.js b/content/kill-overlays.js
index f082c14..c29ec2c 100644
--- a/content/kill-overlays.js
+++ b/content/kill-overlays.js
@@ -5,17 +5,28 @@
* @keyword kill-overlays
*/
(function killOverlays() {
+ /* Remove known overlays. */
+ var selectors = [
+ 'body [class^="nyroModal"]',
+ '.optimonk-holder',
+ '#spout-friendly-iframe',
+ ];
+
+ [].forEach.call(
+ document.querySelectorAll(selectors.join(', ')),
+ function (elem) {
+ elem.parentNode.removeChild(elem);
+ }
+ );
+
/* Remove "suspicious" elements. */
var selectors = [
'body [class*="modal"]',
'body [class*="overlay"]',
'body [class*="popup"]',
'body [style*="width"][style*="height"][style*="100%"]',
- 'body [class^="nyroModal"]',
'.frame-container',
- '.optimonk-holder',
'iframe[style]',
- '#spout-friendly-iframe',
];
[].forEach.call(