Get referrer widget: unable to return full URL address when using Chrome or Edge

  • OphthalmologyEducation
    Asked on January 20, 2021 at 11:11 PM

    Related: https://www.jotform.com/answers/2644896-Get-Referrer-Widget-It-s-not-working-in-Chrome-and-Edge-But-work-in-Firefox-and-Internet-Explorer-

    Issue:

    This issue will apply when for example embedding feedback forms within a web page. The jotform will be loaded as an iframe, and will be unable to obtain the full address of the parent (referrer) page. Instead of capturing the full path (for example: https://use.ob3.io/#/1111111-1f01-11eb-b91e-000000000000/) the form would just capture the domain (https://use.ob3.io)

    Jotform developers reading this ticket - please see https://stackoverflow.com/questions/3420004/access-parent-url-from-iframe for discussions of alternative ways that referrer URL could be passed in to the iframe.

    If you have any workaround for this issue please let me know.

    ~ Rodney

  • Richie JotForm Support
    Replied on January 21, 2021 at 2:26 AM

    I am able to replicate the issue at my end.

    1611213937 60092c71d09a0 1 Screenshot 10

    I have forwarded the issue to our back-end team for further investigation.

    Once we have updates, you will be notified at this support ticket.


  • OphthalmologyEducation
    Replied on January 21, 2021 at 5:28 PM

    Hi Richie,

    For other users experiencing this issue, the best solution at the moment is to change the embed URL to pass in additional params.


    E.g. instead of using https://form.jotform.co/91750767030860 use something like https://form.jotform.co/91750767030860?my_extra_params_here

    Jotform will ignore the params passed in via "?" but will report these back in the Referrer URL field when used in an embedded context.

    It does require customising the embed in each page to add a unique identifier which is extra work, but it is a solution that will work with Chrome's security updates.

    Note that other browsers such as Firefox are moving in this direction. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy

    If your 2nd level support / developers have any further ideas please get back to me. The other solution is to allow support of passing in details via the frame embed, as documented in the Stackoverflow page I supplied, but would require changes at your end to support. We'd be happy to test any advanced solution you come up with.

    ~ Rodney

  • Richie JotForm Support
    Replied on January 21, 2021 at 8:55 PM

    Thank you for sharing your work around.

    Once our developers has updates, you will be notified at this support ticket.


  • Harut
    Replied on July 29, 2022 at 7:36 AM

    Hello, The reason why the full url (or no url at all) is not showing is because browsers have many security requirements. Please add the following script on the page where you've embedded the form (within the body or the head tags of your HTML page): 

    <script src="https://app-widgets.jotform.io/scripts/getUrlReferrer.js"></script>

    The script will help in getting the accurate url when the form is submitted. 

    Please give that a try and let us know how that goes