Izimpendulo zakamuva ze-Export console xhr responseshttps://support.mozilla.org/zu/questions/12774742020-01-21T21:53:17-08:00Thank You Cor-el !
I managed to get this to work :
function logJson(requestDetails) {
con2020-01-21T21:53:17-08:00oudin.manuelhttps://support.mozilla.org/zu/questions/1277474#answer-1283482<p>Thank You Cor-el&nbsp;!
</p><p>I managed to get this to work&nbsp;:
function logJson(requestDetails) {
</p><pre> console.log("loading&nbsp;: " + requestDetails.url);
console.log("loaded Json&nbsp;: " + requestDetails.type );
</pre>
<p>}
</p><p>browser.webRequest.onCompleted.addListener(
</p><pre> logRequests,
{urls: ["*://*.mywebsite.com/*"],
types: ["xmlhttprequest"]
}
</pre>
<p>);
</p><p>This code allows me to get a log line on every json that's loaded in the webpage (confirmed with network console)
I tried to adapt the code to save the jsons on my Hard drive in real time.
</p><p>The code i found with your links allows to show the urls of loaded pages, <em>on a click</em> ... Is there a way to actually save this HAR as a file on a hard drive in realtime, or a regular basis&nbsp;? (every second ...)
</p><p>The aim for me is to analyse the loaded jsons in realtime, to show a popup when certains conditions are met inside the json (heavy values calculations to do ...)
</p><p>either by saving the jsons somewher, so that I can analyse them with an outside tool (script)
</p><p>Either by opening them "on the fly" inside the firefox extension, to make the calculation.
</p><p>With the given code, I can't figure a way to extract the json response ...
</p>You can create a HAR archive (HTTP Archive) for data in the Web Console (right-click: Save All As HA2020-01-16T01:08:15-08:00cor-elhttps://support.mozilla.org/zu/questions/1277474#answer-1281661<p>You can create a HAR archive (HTTP Archive) for data in the Web Console (right-click: Save All As HAR).
</p>
<ul><li><a href="https://developer.mozilla.org/en-US/Tools/Network_Monitor" rel="nofollow">https://developer.mozilla.org/en-US/Tools/Network_Monitor</a>
</li><li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.network/getHAR" rel="nofollow">https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.network/getHAR</a>
</li></ul>
<hr>
<ul><li><a href="https://www.softwareishard.com/blog/har-12-spec/" rel="nofollow">https://www.softwareishard.com/blog/har-12-spec/</a>
</li><li><a href="https://www.softwareishard.com/blog/har-viewer/" rel="nofollow">https://www.softwareishard.com/blog/har-viewer/</a>
</li></ul>