From 2cc88bc4407e2237838e3406e665f9d41d14eae1 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Fri, 12 May 2023 13:44:14 -0400 Subject: [PATCH] LP1915326: Followup to Silence Offline / Shared Worker Errors The user agent string hasn't been 'PhantomJS' for quite some time, so look for 'Headless' and add that to the Firefox launcher. Also redirect requests for offline-db-worker.js to the current directory. Signed-off-by: Jason Boyer Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- Open-ILS/web/js/ui/default/staff/services/lovefield.js | 2 +- Open-ILS/web/js/ui/default/staff/test/karma.conf.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/lovefield.js b/Open-ILS/web/js/ui/default/staff/services/lovefield.js index 08d0e01c6a..7953ce92b6 100644 --- a/Open-ILS/web/js/ui/default/staff/services/lovefield.js +++ b/Open-ILS/web/js/ui/default/staff/services/lovefield.js @@ -36,7 +36,7 @@ angular.module('egCoreMod') service.worker.onerror = function(err) { // avoid spamming unit test runner on failure to connect. - if (!navigator.userAgent.match(/PhantomJS/)) { + if (!navigator.userAgent.match(/Headless/)) { console.error('Error loading shared worker', err); } service.cannotConnect = true; diff --git a/Open-ILS/web/js/ui/default/staff/test/karma.conf.js b/Open-ILS/web/js/ui/default/staff/test/karma.conf.js index 25669924a8..6438b066ca 100644 --- a/Open-ILS/web/js/ui/default/staff/test/karma.conf.js +++ b/Open-ILS/web/js/ui/default/staff/test/karma.conf.js @@ -39,6 +39,10 @@ module.exports = function(config){ 'test/unit/**/*.js' ], + proxies: { + '/js/ui/default/staff/offline-db-worker.js' : 'offline-db-worker.js' + }, + // test results reporter to use // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' reporters: ['spec'], // detailed report @@ -60,6 +64,10 @@ module.exports = function(config){ flags: [ '-headless', ], + prefs: { + 'privacy.resistFingerprinting': false, + 'general.useragent.override': 'FirefoxHeadless' + }, } }, -- 2.11.0