summaryrefslogtreecommitdiffstats
path: root/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html')
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
new file mode 100644
index 000000000..af44b45a2
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <script>
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', function() {
+ navigator.serviceWorker.register('/sw.js').then(function(registration) {
+ console.log('ServiceWorker registration successful with scope: ', registration.scope);
+ }, function(err) {
+ console.error('ServiceWorker registration failed: ', err);
+ });
+ });
+ }
+ </script>
+ </body>
+</html>