Browser unsupported using TruClient Browser for WebInspect


I need to scan this app that does not support Firefox browser (cannot ask the developer to change this because we need to comply with company policy).

When I want to setup the login macro, I tried to change the user agent in the TruClient setting as mentioned here:  [WebInspect] How do I set TruClient to use Chromium based browser instead of Firefox ? however it is not working in my case.

Does anyone has experienced this kind of issue? Is there any workaround I can try to solve this issue?

Any help will be much appreciated. Thanks 

  • In order to "trick" the web application into accepting TruClient (Firefox), you have to understand how the web application is detecting which browser is being utilized. "it is not working in my case" does not provide a lot to work with regarding providing a solution. What error are you receiving when you try accessing the site?

  • Hello Ethan, thanks for replying. Here what it looks like when I opened in Truclient. Even after I changed the User Agent in Truclient Setting it remained the same like this. Somehow the developer enable checking the browser that we use to render the page and give this error if we use Firefox (due to company policy they have to do this).

    Do you know is there any way I can "trick" the app besides changing the user agent in setting?

  • In order to satisfy the requirements, you need to understand how the site is detecting the browser you are using. Then we can try an work from there.

  • Hi Ethan, from what I see they blocked Firefox from the code behind. Once it detecting internet browser is Firefox, it will block it automatically. Is there any way that we can do in the TruClient to skip the checking?

  • If you notice the code at the top to identify Firefox is commented out, but let's take for example the one identifying Chrome:

    !! && (!! || !! || navigator.userAgent.match(/Chrome/i));

    We can satisfy the second condition by modifying the userAgent, which you've tried. The challenge now is satisfying As the macro recorder is based on Firefox, we return false or an "undefined" as our condition is window.netscape.

    The other question is if we can "spoof" this are they using the Chrome global variable for other JS scripts that my break?

  • Suggested Answer

    Now, it depends on where you check this. If you are checking on page load event you can add a navigate step that ends on "DOM Content Loaded" and set an Evaluate JS step with the following content:

    let script_tag = document.createElement("script"); = '1'
    script_tag.type = 'text/javascript';
    script_tag.text = ' = true';

    If you are checking on DOM Content Loaded, set the previous step to action complete. The code will inject the script to the page and define a property ( so it will pass the first check. Then you will need to set the User Agent to satisfy the second.