From 68c4a47bf3cf13228ae0a71b1e8f626d8a446a46 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 25 Jun 2010 21:29:22 +0000 Subject: [PATCH] - don't automatically associate .edu sites (except Project MUSE) - if a docShell has allowMetaRedirects turned off (as is the case in our hidden browsers), don't proxy --- chrome/content/zotero/xpcom/proxy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js index 5f7efb2e55..f92e59b90e 100644 --- a/chrome/content/zotero/xpcom/proxy.js +++ b/chrome/content/zotero/xpcom/proxy.js @@ -112,9 +112,10 @@ Zotero.Proxies = new function() { var webNav = null; try { webNav = channel.notificationCallbacks.QueryInterface(Components.interfaces.nsIWebNavigation); + docShell = channel.notificationCallbacks.QueryInterface(Components.interfaces.nsIDocShell); } catch(e) {} - if(webNav) { + if(webNav && docShell && docShell.allowMetaRedirects) { var proxied = Zotero.Proxies.properToProxy(url, true); if(proxied) { channel.QueryInterface(Components.interfaces.nsIHttpChannel); @@ -273,6 +274,7 @@ Zotero.Proxies = new function() { * @const */ const hostBlacklist = [ + /edu$/, /google\.com$/, /wikipedia\.org$/, /^[^.]*$/ @@ -283,7 +285,8 @@ Zotero.Proxies = new function() { * @const */ const hostWhitelist = [ - /^scholar\.google\.com$/ + /^scholar\.google\.com$/, + /^muse\.jhu\.edu$/ ] for each(var blackPattern in hostBlacklist) {