| 
									
										
										
										
											2021-01-07 16:15:34 -08:00
										 |  |  | <!--
 | 
					
						
							|  |  |  |   Copyright (c) Microsoft Corporation. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Licensed under the Apache License, Version 2.0 (the "License"); | 
					
						
							|  |  |  |   you may not use this file except in compliance with the License. | 
					
						
							|  |  |  |   You may obtain a copy of the License at | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       http://www.apache.org/licenses/LICENSE-2.0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Unless required by applicable law or agreed to in writing, software | 
					
						
							|  |  |  |   distributed under the License is distributed on an "AS IS" BASIS, | 
					
						
							|  |  |  |   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
					
						
							|  |  |  |   See the License for the specific language governing permissions and | 
					
						
							|  |  |  |   limitations under the License. | 
					
						
							|  |  |  | --> | 
					
						
							|  |  |  | <!DOCTYPE html> | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  | <html lang="en"> | 
					
						
							| 
									
										
										
										
											2021-01-07 16:15:34 -08:00
										 |  |  |   <head> | 
					
						
							|  |  |  |     <meta charset="UTF-8"> | 
					
						
							|  |  |  |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 
					
						
							| 
									
										
										
										
											2023-08-21 18:33:02 +02:00
										 |  |  |     <link rel="icon" href="/playwright-logo.svg" type="image/svg+xml"> | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |     <link rel="manifest" href="/manifest.webmanifest"> | 
					
						
							| 
									
										
										
										
											2021-01-07 16:15:34 -08:00
										 |  |  |     <title>Playwright Trace Viewer</title> | 
					
						
							|  |  |  |   </head> | 
					
						
							|  |  |  |   <body> | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |     <div id="root"></div> | 
					
						
							|  |  |  |     <script type="module" src="/src/index.tsx"></script> | 
					
						
							| 
									
										
										
										
											2022-08-09 15:53:11 -07:00
										 |  |  |     <dialog id="fallback-error"> | 
					
						
							|  |  |  |       <p>The Playwright Trace Viewer must be loaded over the <code>http://</code> or <code>https://</code> protocols.</p> | 
					
						
							|  |  |  |       <p>For more information, please see the <a href="https://aka.ms/playwright/trace-viewer-file-protocol">docs</a>.</p> | 
					
						
							|  |  |  |     </dialog> | 
					
						
							|  |  |  |     <script> | 
					
						
							| 
									
										
										
										
											2024-10-23 12:19:29 +02:00
										 |  |  |       if (!/^https?:/.test(window.location.protocol)) { | 
					
						
							|  |  |  |         const fallbackErrorDialog = document.getElementById('fallback-error'); | 
					
						
							|  |  |  |         const isTraceViewerInsidePlaywrightReport = window.location.protocol === 'file:' && window.location.pathname.endsWith('/playwright-report/trace/index.html'); | 
					
						
							|  |  |  |         // Best-effort to show the report path in the dialog. | 
					
						
							|  |  |  |         if (isTraceViewerInsidePlaywrightReport) { | 
					
						
							|  |  |  |           const reportPath = (() => { | 
					
						
							|  |  |  |             const base = window.location.pathname.replace(/\/trace\/index\.html$/, ''); | 
					
						
							|  |  |  |             if (navigator.platform === 'Win32') | 
					
						
							|  |  |  |               return base.replace(/^\//, '').replace(/\//g, '\\\\'); | 
					
						
							|  |  |  |             return base; | 
					
						
							|  |  |  |           })(); | 
					
						
							|  |  |  |           const reportLink = document.createElement('div'); | 
					
						
							|  |  |  |           const command = `npx playwright show-report ${reportPath}`; | 
					
						
							|  |  |  |           reportLink.innerHTML = `You can open the report via <code>${command}</code> from your Playwright project. <button type="button">Copy Command</button>`; | 
					
						
							|  |  |  |           fallbackErrorDialog.insertBefore(reportLink, fallbackErrorDialog.children[1]); | 
					
						
							|  |  |  |           reportLink.querySelector('button').addEventListener('click', () => navigator.clipboard.writeText(command)); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         fallbackErrorDialog.show(); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-08-09 15:53:11 -07:00
										 |  |  |     </script> | 
					
						
							| 
									
										
										
										
											2021-01-07 16:15:34 -08:00
										 |  |  |   </body> | 
					
						
							|  |  |  | </html> |