Hi all,

Attached is a simple patch for a problem that I find extremely
annoying when using Noscript in combination with Conkeror. The problem
is that the ns-toggle-temp function will also query the user for url's
that are already enabled in the Noscript config and then set them to
temporarily enabled even if they were previously permanently enabled.
This patch filters out url's that were already enabled before asking
for further approvals. I would like this to be included in Conkeror
proper. The patch is licensed to anyone under conkeror's licenses (MPL
1.1 or higher, GNU GPL 2 or higher or LGPL 2.1 or higher).

Dominique
From 1ee1f429de9d11736b3063dd593936ff58de22c5 Mon Sep 17 00:00:00 2001
From: Dominique Devriese <[email protected]>
Date: Tue, 29 Mar 2011 13:48:19 +0200
Subject: [PATCH] Fix a problem in the noscript extension. The problem is that the
 ns-toggle-temp function will also query the user for url's that are
 already enabled in the Noscript config and then set them to
 temporarily enabled even if they were previously permanently enabled.
 This patch filters out url's that are already enabled before asking
 for further approvals.

---
 modules/extensions/noscript.js |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/extensions/noscript.js b/modules/extensions/noscript.js
index 98f3a24..1af217a 100644
--- a/modules/extensions/noscript.js
+++ b/modules/extensions/noscript.js
@@ -106,6 +106,7 @@ interactive("ns-toggle-temp", "Allow a site temporary access to javascript",   f
 	    }
 	}
 	urls = unique(urls);
+	urls = urls.filter( function(u) { return !ns.isJSEnabled(u); });
 	while ((url2 = urls.pop())) {
 	    ns_allow_temp(url2, I.buffer,I.P, (yield I.minibuffer.read ($prompt = "Allow "+url2+"? [Y/[N]]")));
 	}
-- 
1.7.4.1

_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to