Make Firefox log requests and responses by default - firefox

Almost every time I use the debug console I have to right click and tick "Log request and response bodies". It's so annoying to forget it from time to time and then have to redo whatever I did to trigger it; and it clears every time I close and open the console.
Is there any way, such as an about:config variable, to make it log these bodies by default? I would even recompile Firefox from sources to do this if someone can tell me where the default is set.

As far as I understand from the relevant issue, this is not something controlled by about:config and the value lives while the developer tools are opened.

Related

Firefox hangs when using developer tools

I am getting a little desperate here: Almost every time I try to use the Firefox browser tools (FF 66.0.3 on Mac, but has been the same in previous versions) to inspect an element, when selecting any page element to show its code in the inspector, the inspector switches to the javascript debugger, marks an error in the jquery.min.js file (complete first line of three) and causes the browser to hang, i.e. I can still scroll the window, but more or less nothing else (for example no reload, no clicking a link would work etc.)
The debugger shows Error: Permission denied to access property "nodeName". I am doing nothing special, I just use the inspector and try to select any element on the page.
The crazy thing is that this happens on most websites, even here on Stackoverflow, so I suppose some particular browser setting must cause this.
I know this is a vague description and therefore a bit off-topic, but I'd be very grateful for any hints how I could fix this.
You most probably have the "Pause on exceptions" and "Pause on caught exceptions" options set to on:
These will cause the debugger to pause javascript execution whenever an exception is thrown, even though the exception has been caught e.g by a try catch block, like many test codes use.
You can un-toggle these to enjoy a more natural experience or click the play icon to resume the javascript.

UFT - Object Identification not working on Run Time

I have written a code for Web page. The process requires me to click on a weblink which opens up a new window, then perform some operations on the browser window. Then I close the new browser. This is repeated multiple times in the code. All the elements on all the browser windows are normally identifiable using the object spy. However, intermittently during run time when a new browser window opens up the elements on the page are not getting recognized (hence it throws errors). When i go into the debug mode and try using the object spy the maximum identification i can capture is Browser(<>).Page(<>). Nothing in the page is getting recognized.
Now if i close this browser and reopen it and check again, the elements on the page are getting captured by the object spy and i can continue with my script execution. Sometimes I have to close and reopen multiple times for it to work.
Is there any way to handle this scenario. check for object identifications on the run time maybe. Dunno if it this is any relevant but i am not making use of the OR in my project.
Thanks in advance.
This sounds like a bug in UFT and you should contact HP's support.
A workaround if you know where the problem is probable to appear is to add Browser("<name>").RefreshWebSupport. This is an undocumented feature of UFT that sometimes helps in cases like this.

How do I know which part of JavaScript is executed when some event is occurred

How do I know which part of JavaScript that is executed when some event is occurred in Mozilla Firefox?
This is a very broad question but I'll take a shot. I was a bit curious about the now native debugger in Firefox so I looked into this for you. Firebug is still a nice tool but you don't need it for debugging if you're running Firefox 19 or later. Let me also suggest trying Chrome's DevTools, they are my personal favorite.
To use the native debugger in Firefox, there's two options you will need to configure. Go to about:config (paste that in the address bar). Proceed past the warning. Update the following settings to be true (search is your friend):
devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true
You need to do that so you can set breakpoints in the code. Now load the debugger, the shortcut is Ctrl+Shift+S.
At this point you need to have some idea where to set your breakpoints. If you wrote the JavaScript, you shouldn't have much trouble. If you're inspecting 3rd party code, you might need to browse the source code to get an idea where to begin.
With the debugger loaded, select a source file in the dropdown. It could be a JavaScript file, or any other resource that has JavaScript. You should open whichever file you're interested in inspecting.
To add a breakpoint, click to the left of the line number. You can also right-click on a given line and select "Add breakpoint." If you are debugging something that happens on page load, refresh the page. If it's an event handler, interact with the page to fire the event.
Those are the basics you'll need to get started with debugging in Firefox. Here are some resources you might need to go further.
MDN article: Debugging JavaScript
YouTube video using FireBug: Firebug DebuggingIntro
Chrome DevTools: Breakpoints in Chrome
I hope that helps!

How to produce a XHR log silently with Chrome

I would like to spot a "random" bug on a site. In order to do that I would like to have all the XHR requests saved in a log file, which is a very easy thing. The problem is that I'm not the user, so I have to set up someone else's machine to do that.
The problem is that the user doesn't know how to use the "developer tools" so I would like to have a tools that keep trace of everything without bothering the user. Bear in mind that this bug can occur once in a day and during this time the user can close the browser and re-open it. Do you have any suggestion? thanks!
I think that the best way would be to make the logs from within the site that you're trying to observe.
If you don't have access to it, another solution might be to find/develop a browser extension that logs any xhr to a local file.

HTML5: Remembering location setting in Firefox

I have a page with a Google Maps component, and I am using navigator.geolocation.getCurrentPosition() on initiating the map so that I can show "local" items.
Everything works great, other than the behavior of the location prompt - In the past I thought I had seen where you could choose to allow FireFox to remember this setting, but that has either been removed from FireFox, or there is some flag/setting that I'm not using that would enable this... anyone have any insight?
See this page for a screencap of the 'remember' checkbox:
http://diveintohtml5.info/geolocation.html
Thanks,
Paul
EDIT:
Ok, looks like I am only seeing this issue in FireFox 4, in that it doesn't seem to give me the option to remember the site in the prompt, which means it prompts each and every time. FireFox 3.5 works as expected. Is this expected behavior? I can manually set it to never ask by going into Page Info for the page, but the typical user is not going to know how to do this.
Well, it appears that version 4.0.1 of FF doesn't have the 'remember permission' checkbox... the user will get prompted each and every time they hit the page until they perform the following steps:
Right-Click->'View Page Info'->'Permissions' Tab->'Share Location' and then un-check 'Always ask' set the radio button to 'allow'.
Seems like most people would never know to look there for this setting though, hopefully they re-introduce the dialog 'remember' checkbox.
If you did already gave permission, Firefox will not ask again. You may undo it according http://www.mozilla.com/en/firefox/geolocation/

Resources