From 7acae3db158099a575c0777d1bad4a3294d6d044 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 24 Oct 2016 01:00:45 +0200 Subject: [PATCH] [fix] Obfuscate `ActiveXObject` occurrences (#509) Some corporate firewalls/proxies such as Blue Coat prevent JavaScript files from being downloaded if they contain the word "ActiveX". --- lib/xmlhttprequest.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/xmlhttprequest.js b/lib/xmlhttprequest.js index aa181d6dd..d76d9c7a0 100644 --- a/lib/xmlhttprequest.js +++ b/lib/xmlhttprequest.js @@ -1,8 +1,5 @@ // browser shim for xmlhttprequest module -// Indicate to eslint that ActiveXObject is global -/* global ActiveXObject */ - var hasCORS = require('has-cors'); module.exports = function (opts) { @@ -34,7 +31,7 @@ module.exports = function (opts) { if (!xdomain) { try { - return new ActiveXObject('Microsoft.XMLHTTP'); + return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); } catch (e) { } } };