I want to use the function 'Preserve log' at the network tab in the Chrome Dev Tools. I searched internet and found following site. However, it does not work as it indicates. Does anyone have used preserve log and generate HAR file from it? Actually, I am wondering about the exact function of 'preserve log' itself.. Is is for generating HAR file?
https://community.box.com/t5/Managing-Content-Troubleshooting/How-to-Generate-a-HAR-File-in-Chrome-IE-or-Firefox/ta-p/366
Could you please help me out with this?
"Preserve log: option this is not the same like saving HAR file. You need preserve log in order to see the log even you refresh the page or move to another page. However you can't save full HAR file if this check box unchecked. So "preserve log" is required for HAR but it has other meaning.
* Disclaimer: Posted by Developer of HttpWatch *
HttpWatch on Windows can record the network traffic generated when a new Chrome tab or window is opened by enabling auto-recording in Tools->Options->Recording. In the new window click on the HttpWatch icon to view the network trace.The log file can either be saved a HAR or in the native HttpWatch format (HWL)
The free version will record a full HWL file that can be opened by someone using HttpWatch Professional.
* Disclaimer: Posted by Developer of HttpWatch *
Related
Sometimes my HTTP responses have rather large content (maybe about 5 MB) and I want to save those together with the rest of the requests in the HAR file. However, the HAR file sometimes only contains part of the response content and sometimes only headers etc but nothing of the content at all. I tried most recent Chrome, Chromium and Firefox browsers.
To reproduce: Open developer tools, record, open a site that returns a large HTTP response (like a big photo JPEG or something) and save the HAR file. It will be much smaller than the size of the JPEG image.
Where is the setting so I can make the developer tool save the full response with the HAR file?
*** Disclaimer: Answer by HttpWatch Developer ***
Our HttpWatch software (Windows only) that works with Chrome and Edge can help you do this. Its default file format (HWL) contains a complete log of all responses whatever their size. The log files can be opened for visual inspection in HttpWatch Studio or examined programmatically using the HttpWatch API.
It can export to HAR files without any restriction on response body size but currently this is only possible using the ExportHAREx automation method:
https://apihelp.httpwatch.com/HttpWatch_API~HttpWatch.Log~ExportHAREx.html
If you save HAR files directly from the HttpWatch browser extensions response bodies are limited to 50 kB.
You can try HttpWatch for free:
https://www.httpwatch.com/download/
or contact support#neumetrix.com for more information
Here is a partial answer for Firefox, at least.
This is the bug report, which induces the patch: https://bugzilla.mozilla.org/show_bug.cgi?id=1223726 Open about:config and change devtools.netmonitor.responseBodyLimit from default value 1048576 to your desired size in bytes.
For example, I know I can use Chrome's "Export HAR..." feature, but if I had the page open for an hour or so, "Export HAR" only saves the contents of the more recent requests, where the archive files representing earlier requests are actually empty. Maybe it depends on the size of the responses, but my archive ended up being 130MB in size and that definitely wasn't all of it.
*** Disclaimer: HttpWatch is a commercial tool and this was posted by its creator Neumetrix Limited ***
With HttpWatch you can automatically record and save to HAR files at regular intervals from Chrome:
https://help.httpwatch.com/automatic_recording.html
You can also use the HttpWatch log file format (HWL) resulting in much smaller log files and then export to HAR files at a later time.
I have a link to the online text editor coderpath: https://coderpad.io/MY_ID:
Users with access to the link can type the text there and the text one user types will become visible to all users on the network (similar to Google Docs).
I would like to periodically download the latest text that is typed there using the linux shell, but a simple command
wget "https://coderpad.io/MY_ID" -O text.txt
downloads some HTML file that does not contain the text I typed.
Since my browser displays the text on my screen, I assume that the browser has downloaded it from the web and thus there should be a way to download it again and save it into my own text file. How?
The reason your wget "https://coderpad.io/MY_ID" -O text.txt command does not download the code you typed into the coderpad is because the command is actually downloading a different content depicted in the image below:
Delete the cookies of your current session or type https://coderpad.io/MY_ID into a new browser and you will also see this image rather than the expected code.
Once you enter the requested name into the page and click Go, a few steps later the browser stores new cookies for this webpage. The main cookie related to this question is:
Cookie name | Cokie value example | Explanation
pad_7JJWMNDA_username | Grace Hopper | Name entered into the bar
For the next requests to refresh the page, the browser will send an HTTP request to the website with this cookie embedded. By examining the cookie value, the server will decide to return the expected code rather than the "Enter your name" request.
In theory, adding appropriate cookie values as extra arguments to the wget command should make the server return the expected code. I did not succeed to download the code this way, because of the multiple hidden requests and responses exchanged between the browser and the server. Those hidden requests complicate the whole download procedure.
However, a workaround that works for me is the following:
Download auto HAR extension from https://github.com/Aloisius/autohar. HAR is basically the log of your browser tab activity with content included.
Change max_entries: 100 to max_entries: 1 in all files. This tells to download the HAR after each page refresh (rather than after 100 page refreshes).
Install this modified extension into the Chrome browser.
Open the new tab and open developer tools for that tab by clicking CTRL + SHIFT + I.
Now whenever you refresh the page in this particular tab, HAR file will be downloaded to your ~/Downloads folder.
That HAR file will contain the custom code of interest. You can then use grep
to extract only the code of interest and filter out the rest of the log.
My Chrome debug console tends to be full of lines like this:
Denying load of chrome-extension://ganlifbpkcplnldliibcbegplfmcfigp/scripts/vendor/jquery/jquery.min.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
How can I find the source of the complaint?
EDIT For clarity: I don't know what extension is causing this. I have dozens installed. The log is not very helpful.
As said by Rob Wu, this is a chrome bug, and it has been reported by him HERE.
By the way, as long as the bug isn't solved, if you are experiencing this issue you'll only need to add the resources that are causing it to your "web_accessible_resources" field in your manifest.
Plus, if you don't know the extension that is causing this, you can find its ID in the console error log, contained in the URL of the resource:
chrome-extension://<extension-id>/path/to/some_file.js
To identify the extension you can then copy the extension ID and go to the extension page chrome://extensions, then enable developer mode checking the box on the top right part of the page and find the ID of the extension either memorizing part of it or pasting it into the search field hitting CTRL+F.
Avast Bank Mode can stop viewing mp4 and .H264 files. Works in normal Chrome Browser, and not in the Bank Mode.
I am on Chrome Dev 27, and in the Dev Tools settings checked Disable cache. When I reload a page, Chrome properly reloads all the resources used by map page, including the .js files. However, it doesn't automatically reload the corresponding source maps .map. Monitoring the HTTP traffic between Chrome my app, on subsequent page load, I don't see any request from Chrome for the .map files. How can I get Chrome to also reload the source maps?
The issue with Chrome not reloading the .map file is that it also won't reload the file from which the .js was generated, which in my case happens to be a CoffeeScript file (.coffee), which means that when debugging, in the Sources tab I am looking at an old version of the .coffee file, even if the new code (from the .js) is running.
I had this same issue just today. The wait to solve it for me was to close the coffee file's tab under sources, go to the network tab, right click, and select "Clear Browser Cache"
This fixed it for me.
That said, the mapped files don't always get "stuck" in cache for me... Only sometimes, and when they do, the clear cache trick fixes it.
Just had the same issue and found some additional solutions:
According to this commit and this bug report for chromium, the problem is solved and should not affect one of the next builds.
A little bit simpler solution for this problem than clearing the whole Browser Cache:
Open the source map in a browser tab and do a hard reload (depending on OS, try CTRL+F5). This refreshes the file and keeps the browser cache.
An alternate way and perhaps a good practise is to hack the source map generation by adding a parameter like ?build=12345. Refer to your build tool on how to manipulte the filename of the source map.
If you have access to the server config or a .htaccess, you could set the header Cache-Control: no-cache for the source map extension like '.js.map'.
Go to settings -> Show advanced settings -> Clear Browsing Data -> Check only "cached images and files" -> Click "clear browsing data"
This will clear the source maps you have cached in the browser without deleting all the cookies.
I resolved the issue by deleting the .map file and performing a hard reload (CTRL-F5).
I didn't want to lose all my history!