fetch-request-css-base-url-iframe.html (651B)
1 <html> 2 <head> 3 <title>iframe for css base url test</title> 4 </head> 5 <body> 6 <script> 7 // Load a stylesheet. Create it dynamically so we can construct the href URL 8 // dynamically. 9 const link = document.createElement('link'); 10 link.rel = 'stylesheet'; 11 link.type = 'text/css'; 12 // Add "request-url-path" to the path to help distinguish the request URL from 13 // the response URL. Add |document.location.search| (chosen by the test main 14 // page) to tell the service worker how to respond to the request. 15 link.href = 'request-url-path/fetch-request-css-base-url-style.css' + 16 document.location.search; 17 document.head.appendChild(link); 18 </script> 19 </body> 20 </html>