-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.4.34, 2.4.35
-
Fix Version/s: HOTFIX_10.10_2.4, 3.x
-
Component/s: UI
-
Environment:Windows
might happen on other browsers or OSes
-
Tags:
-
Browser:
What: the internal JS script sw.js is displayed to users
How to reproduce:
- Take the the Nuxeo ZIP distribution and unjar it
cd nuxeo-server-10.10-tomcat/bin nuxeoctl register # (use a Studio TOKEN) nuxeoctl mp-hotfix --accept=true nuxeoctl mp-install nuxeo-web-ui nuxeo-jsf-ui --accept=true nuxeoctl console
- invoke http://localhost:8080
- fill in the wizard information: all default (including Dev mode) but no need to install any other package
- reboot from the GUI and wait for login page
- login as Administrator/Administrator
=> The resulting URL looks like: http://localhost:8080/nuxeo/ui/sw.js?ts=1605452580213
=> the page looks likeimportScripts('workbox/workbox-sw.js'); workbox.loadModule('workbox-strategies'); const params = new URL(self.location.href).searchParams; if (params.has('ts')) { workbox.routing.registerRoute( ({ url, event }) => /\.*\.(html|js)$/.test(url) && event.request.headers.get('Content-Type') !== 'application/json', async ({ url, event }) => { const strategy = workbox.strategies.networkFirst(); const request = new Request(`${url}?ts=${params.get('ts')}`, { credentials: 'same-origin' }); return await strategy.makeRequest({ event, request }); }); } self.addEventListener('install', () => { self.skipWaiting(); });
Expected result: sw.js should never get displayed.
- is caused by
-
WEBUI-86 Find a solution to bypass ServiceWorker for documents whose name end with .html
- Resolved