From 27999484c2ff4d23e61f815cab909e94a85d1952 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Thu, 30 May 2019 12:43:47 +0200 Subject: [PATCH] Server-site navigator protection did not respect whitelisting Should fix #362 --- lib/navigator.js | 5 ++++- manifest.json | 2 ++ releaseNotes.txt | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/navigator.js b/lib/navigator.js index f7f8cd7..fd962b3 100644 --- a/lib/navigator.js +++ b/lib/navigator.js @@ -14,6 +14,7 @@ const settings = require("./settings"); const logging = require("./logging"); + const check = require("./check"); scope.allProperties = [ "appCodeName", "appName", @@ -67,8 +68,10 @@ }; function changeHTTPHeader(details){ + const url = new URL(details.url); if ( - settings.protectNavigator && + settings.get("protectNavigator", url) && + check.check({url}).mode !== "allow" && ( !settings.protectedAPIFeatures.hasOwnProperty("userAgent") || settings.protectedAPIFeatures.userAgent diff --git a/manifest.json b/manifest.json index 3275910..9fca75e 100644 --- a/manifest.json +++ b/manifest.json @@ -18,6 +18,8 @@ "lib/settings.js", "lib/lists.js", "lib/persistentRndStorage.js", + "lib/callingStack.js", + "lib/check.js", "lib/dataUrls.js", "lib/notification.js", "lib/navigator.js", diff --git a/releaseNotes.txt b/releaseNotes.txt index 5eaf255..28910be 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -13,6 +13,7 @@ Version 0.5.10: - detection over document.write and document.writeln was possible - google docs were broken in Waterfox - MutationObserver failed in some instances + - server-site navigator protection did not respect whitelisting known issues: - if a data URL is blocked the page action button does not appear