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?
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?
@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
@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
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>
openWindow()
. However the page opens with an message on browser screen — ERR_BLOCKED_BY_CLIENT
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
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.