How to fix freshworks iframe bolcked another domain?

hi all

i am tried freshdesk show madal in anchor tag click new window open but client is blocked error is occur.
i am tried w3 school open link and display data.

how to solve?

1 Like

@annalakshmi,
Good day!
Hope you are doing good!
As you know the app is rendered in an Iframe, and you can’t open a link in a new tab/window via iframe since it is sandboxed, you can’t open a link like the way you suggested,
but you can do it via javascript

eg:
window.open(redirectUrl, ‘_blank’);

Thanks

1 Like

Thanks,
I tried this but error is occur?



how to solve?

I am tried in freshdesk modal in,


click anchor tag open window but thie error is occur.

@annalakshmi,
Seems like there is an issue with the URL which you generated,
can you please try comparing the URL which you generated and the actual URL or
try to copy the link from your Ancor tag (which you are generating) put it in your new tab manually and verify?

Thanks

@Santhosh

I tried reproducing this issue with usual as follows:

//index.html of app loading in ticketsidebar
<html>
  <head>
    <script src="https://static.freshdev.io/fdk/2.0/assets/fresh_client.js"></script>
    <link rel="stylesheet" type="text/css" href="styles/style.css" />
    <link rel="stylesheet" type="text/css" href="https://static.freshdev.io/fdk/2.0/assets/freshdesk.css" />
  </head>

  <body>
    <div class="fw-widget-wrapper">
      <p><a href="http://www.africau.edu/images/default/sample.pdf" target="_blank">Freshworks Neo</a></p>

      <p id="apptext"></p>
    </div>
  </body>
  <script>
    console.log('attempt: Open New Tab');
    openWindow();
    function openWindow() {
      window.open('http://www.africau.edu/images/default/sample.pdf', '_blank');
    }
  </script>
  <script src="scripts/app.js"></script>
</html>
  1. In the console I could invoke openWindow(). However the page opens with an message on browser screen — ERR_BLOCKED_BY_CLIENT
  2. However, if I substitute the URL with either freshdesk.com or freshworks.com the tab opens up without any issues.

Instead of HTML, I used JS (window.open(..) ) to open the new tab.

Still, it doesn’t seem to work. I might be missing something.

@Saif @annalakshmi ,
The browser is blocking loading the PDF, if you are loading any other website site, it will work, but it is different for PDF (browser won’t allow from Iframe due to some sandbox settings), we generally advise downloading the PDF instead of opening it in the browser.

Thanks

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.