What is HAR file? How to Generate or Open HAR Files?
HAR file is a JSON archive file format that stores browsing data over multiple browsers. It works by storing a data session between the client and server. In other words, a HAR file is used to save all the web requests made on the browser. More than often the file is used to analyze, and find vulnerabilities.
HAR is expanded as HTTP Archive Format and can be classified as a JSON archive file format. Developers and security researchers use this file to detect bugs and vulnerabilities. Furthermore, HAR file makes it easier to solve website performance issues across multiple browsers. It includes HTTP response and request headers. HAR file comes with a “.har” extension.
Website performance is very important for many reasons. More than often websites suffer from slow loading speed, sluggish page rendering process, and consume excessive computing resources. In such cases one could generate HAR file and analyze the same. This way the site administrator can fix performance issues with the website and ensure optimum performance.
How to open HAR files?
Users can generate & open HAR files on Google Chrome, Firefox, or any other browser. All you need to do is follow some simple steps. Please note that the HAR file is specific for each URL.
Generate HAR file on Google Chrome Browser
- Open Chrome browser and the webpage that needs to be analyzed.
- Open Developer Tools by clicking on three dots at the top right
- Select Developer Tool or you can use CTRL+Shift+I shortcut on Windows
- Select Network tab
- Click on the small red button on the left side of the menu pane. If the button is greyed then that means it is already recording
- To avoid confusion you can delete log records kept on the browser by clicking ‘Clear icon’
- After recording the event you can right-click and select “Save as HAR file.”
How to Generate HAR file on Firefox?
- Open Chrome browser and the webpage that needs to be analyzed.
- Open Developer tool by clicking on three horizontal parallel lines on the top-right of the browser. Select Developer>Network
- The Developer Tools will open and can be accessed from the bottom of Firefox. Click on the Network tab
- Firefox will automatically start recording the event. You can reproduce the issue while the browser is recording
- Once done you can access the HAR file in the Developer Network Panel.
- Go to the File column and Right Click “Save all as HAR> Save the file.”
We hope you were able to generate and store HAR files for debugging and other purposes. Furthermore, you can use Google’s HAR Analyser to capture HTTP session and analyse the same for errors and other issues.