How to Generate a HAR File in Chrome, IE, Firefox, and Safari, Edge
Objective
This article shows how to Generate a HAR File in Chrome, IE, Firefox, and Safari. Microsoft Edge (Chromium) is almost the same as Google Chrome.
Environment
- HAR File
- Web Browser (Chrome, Firefox, IE, Safari)
Procedure
HAR files are used to gather performance data from the end-users' web browser. It will capture objects, and response calls that a webpage generates.
Additional metrics that can be gathered by HAR are:
- Length of time that it takes to connect to the server.
- Length of time to gather DNS information.
- Length of time that it takes to transfer assets from the server to the browser.
- Length of time that an object takes to be requested.
As various ways HAR files are used, Palo Alto Network's support engineers might require you to capture data for troubleshooting purposes.
How to generate a HAR and log file in Chrome
- Open Google Chrome.
- In Chrome, go to the webpage in question.
- Select the Chrome menu > More Tools > Developer Tools
- Select the Networks tab.
- Within the Networks tab, Click the checkbox for the Preserve log option.
- Look for a round record button in the upper left corner of the tab, and make sure it is red. If its color is red the recording is in progress and grey means its not recording anything.
- Record the log by selecting the grey circle at the top left of the Networks tab.
- Refresh the page and allow Chrome to record browser-website interaction.
- Once the page is loaded, select the Export HAR (downward-facing arrow)
. "Save as..." name the file as your preference.
- Go back to the Networks tab and right-click anywhere in the "Name" column (with many different file names), select "Save HAR with content".
- Upload HAR and log files to the support ticket.
How to generate a HAR and log file in Firefox
- Open Firefox.
- In Firefox, go to the webpage in question.
- Select the Firefox menu > Web Developer > Network.
- Within the Networks tab, select Preserve log option.
- In the center of the Networks tab select refresh.
- Refresh the page and allow Firefox to record the browser-website interaction.
- Once the page is loaded, right click and "Save All As HAR".
- Select the Console tab and right-click on in the console box. Select all and Copy Message
- Copy log messages to the preferred text editor.
- Upload the HAR and log files to the support ticket.
How to generate a HAR and log file in Safari
- Open Safari.
- In Safari, go to the webpage in question.
- Enable Developers Tool: Safari > Preferences > Advance > Click Show Develop menu in menu bar
- Select Develop in menu > Show Web Inspector > Select Network tab
- Within the Networks tab, select Preserve log option.
- Refresh the page and allow Safari to record the browser-website interaction.
- Once the page is loaded, click on Export on the top right in the window of the Network tab.
- Select the Console tab and screen capture the errors.
- Upload the HAR and console screenshot files to the support ticket.
How to generate a HAR and log file in Internet Explorer (IE)
- Open IE.
- In IE, go to the webpage in question.
- To open Developers Tool, press the F12 key on your keyboard, or you may find the Developers Tool in the menu.
- In the Developers Tool menu > Network panel and then deselect the Clear entries on navigate option. (Default)
- Select Start Profiling Session/Start Capture.
- Refresh the page and allow IE to record the browser-website interaction.
- Once the page is loaded, click on Export as HAR/Export capture traffic icon and save
- Click on the Console tab and look for any errors/warnings reported. If errors are shown, please right-click on the console errors and select Copy all.
- Upload the HAR and log files to the support ticket.
How to generate a HAR and log file in Microsoft Edge (Chromium)
You can collect a HAR (HTTP Archive) file in Microsoft Edge by following these steps:
-
Open Microsoft Edge and navigate to the webpage where you want to reproduce the issue or capture network activity.
-
Open Developer Tools:
-
Press
F12on your keyboard. -
Alternatively, right-click anywhere on the page and select "Inspect."
-
Or, click on the three-dot menu (
...) in the top right corner of Edge, go to "More tools," and then select "Developer Tools."
-
-
Go to the Network Tab: In the Developer Tools window, click on the "Network" tab.
-
Clear Existing Logs (Optional but Recommended): To ensure you capture only the relevant activity, click the "Clear" button (a circle with a slash through it, or a clear icon) to clear any previous network requests.
-
Start Recording: The recording usually starts automatically when you open the Network tab. If not, look for a red circular "Record" button and click it to start. It should turn red and indicate that it's recording.
-
Reproduce the Issue: Perform the actions on the webpage that are causing the problem or that you want to capture the network traffic for. This is crucial for the HAR file to contain the relevant information.
-
Stop Recording (Optional, but good practice): Once you've reproduced the issue or captured enough activity, you can click the red circular "Record" button again to stop recording.
-
Export as HAR:
-
Right-click anywhere within the list of network requests.
-
Select "Save all as HAR with content" (or "Save all as HAR").
-
-
Save the File: A "Save As" dialog box will appear. Choose a location on your computer to save the
.harfile and give it a meaningful name.
You now have a HAR file that can be used to analyze the network requests, responses, and timing information, which is very helpful for troubleshooting web-related issues.
Additional Information
Microsoft Docs > Azure > Product documentation > Architecture > Learn azure > Desktop > Resources
Capture a browser trace for troubleshooting
How to generate a HAR file for troubleshooting