Service worker - intermittent object DOMException error

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Service worker - intermittent object DOMException error

Postby HarmlessDave » Wed Jun 03, 2020 5:17 pm

CEF 78.3.1+g8819d2e+chromium-78.0.3904.87 - Windows 32-bit, /LARGEADDRESSAWARE

Our application uses an external message pump since we want accessibility to work (as well as it does).

So far we've replicated this on multiple PCs but only in our application not in CEFClient .

Has anyone else had intermittent failures with a service worker, even after "support was improved in version 75"? Did you find any way to get around the problem?

Page with sample dummy service worker
Code: Select all
<!DOCTYPE html>
<html>
<head>
<script>
        window.addEventListener("load", () => {
            console.log("***window onload");
            if ('serviceWorker' in navigator) {
                console.log("***serviceWorker in navigator");
                navigator.serviceWorker.ready.then(registration => {
                    console.log("***service worker ready");
                });

                console.log('service worker registration attempt #1');
                navigator.serviceWorker.register('https://samplesite.com/support/sample/sw.js', {scope: "/support/sample/"}).then(registration => {
                    console.log('***service worker registration #1 successful with scope: ', registration.scope);

                    console.log('***service worker registration attempt #2a');
                    navigator.serviceWorker.register("https://samplesite.com/support/sample/sw2.js", {scope: "/support/sample/"}).then(registration => {
                        console.log('***service worker registration #2a successful with scope: ', registration.scope);
                    }, err => {
                        console.log('***service worker registration #2a failed: ', err);
                    });


                }, err => {
                    console.log('***service worker registration #1 failed: ', err);


                    console.log('***service worker registration attempt #2b');
                    navigator.serviceWorker.register("https://samplesite.com/support/sample/sw2.js", {scope: "/support/sample/"}).then(registration => {
                        console.log('***service worker registration #2b successful with scope: ', registration.scope);
                    }, err => {
                        console.log('***service worker registration #2b failed: ', err);

                        console.log('***service worker registration attempt #3');
                        navigator.serviceWorker.register("https://samplesite.com/support/sample/sw3.js", {scope: "/support/sample/"}).then(registration => {
                            console.log('***service worker registration #3 successful with scope: ', registration.scope);
                        }, err => {
                            console.log('***service worker registration #3 failed: ', err);

                            console.log('***service worker registration attempt #4');
                            navigator.serviceWorker.register("https://samplesite.com/support/sample/sw4.js", {scope: "/support/sample/"}).then(registration => {
                                console.log('***service worker registration #4 successful with scope: ', registration.scope);
                            }, err => {
                                console.log('***service worker registration #4 failed: ', err);
                        });
                        });
                    });
                });
            }
        });
    </script>
</head>
<body>
    Service worker issue demo.
</body>
</html>


Log entries for failure
Code: Select all
14:48:56.795 - CEF: ***window onload  (https://samplesite.com/support/sample/  ln 9  lev 2)
14:48:56.800 - CEF: ***serviceWorker in navigator  (https://samplesite.com/support/sample/  ln 11  lev 2)
14:48:56.800 - CEF: service worker registration attempt #1  (https://samplesite.com/support/sample/  ln 16  lev 2)
14:48:56.814 - CEF: ***service worker registration #1 failed:  [object DOMException]  (https://samplesite.com/support/sample/  ln 30  lev 2)
14:48:56.814 - CEF: ***service worker registration attempt #2b  (https://samplesite.com/support/sample/  ln 33  lev 2)
14:48:56.814 - CEF: ***service worker registration #2b failed:  [object DOMException]  (https://samplesite.com/support/sample/  ln 37  lev 2)
14:48:56.814 - CEF: ***service worker registration attempt #3  (https://samplesite.com/support/sample/  ln 39  lev 2)
14:48:56.814 - CEF: ***service worker registration #3 failed:  [object DOMException]  (https://samplesite.com/support/sample/  ln 43  lev 2)
14:48:56.814 - CEF: ***service worker registration attempt #4  (https://samplesite.com/support/sample/  ln 45  lev 2)
14:48:56.814 - CEF: ***service worker registration #4 failed:  [object DOMException]  (https://samplesite.com/support/sample/  ln 49  lev 2)


Log entries for success
Code: Select all
14:47:14.619 - CEF: ***window onload  (https://samplesite.com/support/sample/  ln 9  lev 2)
14:47:14.625 - CEF: ***serviceWorker in navigator  (https://samplesite.com/support/sample/  ln 11  lev 2)
14:47:14.625 - CEF: service worker registration attempt #1  (https://samplesite.com/support/sample/  ln 16  lev 2)
14:47:14.737 - CEF: ***service worker registration #1 successful with scope:  https://samplesite.com/support/sample/  (https://samplesite.com/support/sample/  ln 18  lev 2)
14:47:14.737 - CEF: ***service worker registration attempt #2a  (https://samplesite.com/support/sample/  ln 21  lev 2)
14:47:14.744 - CEF: ***service worker ready  (https://samplesite.com/support/sample/  ln 13  lev 2)
14:47:14.844 - CEF: ***service worker registration #2a successful with scope:  https://samplesite.com/support/sample/  (https://samplesite.com/support/sample/  ln 23  lev 2)


Any suggestions are appreicated
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 32 guests