diff options
author | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2020-05-08 07:49:35 +0200 |
---|---|---|
committer | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2020-05-26 00:39:16 +0200 |
commit | f3b0a9b8563e2ff6298db219b782992a52d6f9ab (patch) | |
tree | a04d0a438192de7fd4aa31acd5569596eddc69fb /tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html | |
parent | 5b8465749963fcb109ab0093c254b476dbe72e66 (diff) |
Add test for first party urls of service worker
Change-Id: Ic26d982ef9695705a9f7c757b7d983824b31a070
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html')
-rw-r--r-- | tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html | 16 |
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> |