LP1915326: Followup to Silence Offline / Shared Worker Errors
authorJason Boyer <JBoyer@equinoxOLI.org>
Fri, 12 May 2023 17:44:14 +0000 (13:44 -0400)
committerJane Sandberg <js7389@princeton.edu>
Sat, 13 May 2023 15:00:33 +0000 (08:00 -0700)
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 <JBoyer@equinoxOLI.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Open-ILS/web/js/ui/default/staff/services/lovefield.js
Open-ILS/web/js/ui/default/staff/test/karma.conf.js

index 08d0e01..7953ce9 100644 (file)
@@ -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;
index 2566992..6438b06 100644 (file)
@@ -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'
+            },
         }
     },