Websites refuse to connect for hyperlinks for new windows

rwvaughn
rwvaughn Community Member Posts: 9 ♪ Opening Act ♪
Websites that use security measures to deter "clickjacking" are prevented from being displayed in a new window with Edge and Chrome showing "refused to connect" messages. I can use javascript to do this, but ideally would like to open all external webpage targets, in a new tab. Regular Windows sometimes has a CNTRL+Click keyboard option to open links in a new tab (try it on this blog's breadcrumb above) Assuming that end users DO NOT customize browser settings from default to open all popups in a new tab, can anyone confirm that this is impossible and why?

Best Answer

  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 574 eLearning ROCKSTAR Admin Team
    Accepted Answer
    For Mac users it will always open in a new tab, none of the window.open tricks that work on windows work on Mac for me.

    Lectora Online does allow Run JavaScript from a hyperlink, we will write an issue to allow it in Lectora Desktop.

Answers

  • andrew-robertson
    andrew-robertson Community Member Posts: 184 ☆ Superstar ☆
    How is your action being set? I've had 0 issues related to this oddly and would like to try it out further.
    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • rwvaughn
    rwvaughn Community Member Posts: 9 ♪ Opening Act ♪

    The action is hyperlinked text and not a button. (What difference would that make?) So you have had 0 issues? Send me a screenshot of Google Search in a new window using standard Go To Web Address > , New window settngs.

  • andrew-robertson
    andrew-robertson Community Member Posts: 184 ☆ Superstar ☆
    How do you want me to provide that to you? From simple review mode? From my LMS? From a simple standalone HTML exported webpage?
    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • rwvaughn
    rwvaughn Community Member Posts: 9 ♪ Opening Act ♪

    Preview in browser mode is fine. Just for fun, set the new window size to 800 x 600.

  • andrew-robertson
    andrew-robertson Community Member Posts: 184 ☆ Superstar ☆
    edited June 15, 2021
    As requested.









    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • rwvaughn
    rwvaughn Community Member Posts: 9 ♪ Opening Act ♪

    Thanks for taking the time. I can only do this with JS (window.open) Couple of questions: Will it work in an AU? Are you using a VPN? Other than that I got nothing.

  • rwvaughn
    rwvaughn Community Member Posts: 9 ♪ Opening Act ♪

  • carlfink
    carlfink Community Member Posts: 943 ♦ Idol ♦
    rwvaughn said:

    Thanks for taking the time. I can only do this with JS (window.open) Couple of questions: Will it work in an AU? Are you using a VPN? Other than that I got nothing.

    Are you using a VPN or other security software that might interfere? Can you try it on another device, ideally one outside your corporate network?
  • rwvaughn
    rwvaughn Community Member Posts: 9 ♪ Opening Act ♪
    Couple of things I see, now that I have studied your screenshots...
    Looks like Preview in Browser mode opens a new tab, not a new window, but run mode and Preview mode all open new windows. (I am amazed how many blogs just say "new window/tab" We can open embedded PDFs in a sized new window, but PDFs on the Web open in a new tab. We are trying to aim for consistency. documents and PDFs, like job aids need to open in a new window, websites and other exernal resources need to open in a new tab. Of course users can configure their browsers, I understand that, but I have to build assuming default settings. What it looks like on the LMS is all that really matters. since there is no Lectora setting for open in new tab vs. open in new window, it is a dog to figure out. Odd that when I ran the run mode to launch the link first, and then ran the Preview mode, it worked, but Preview in Browser gets wonky.
  • andrew-robertson
    andrew-robertson Community Member Posts: 184 ☆ Superstar ☆
    edited June 15, 2021
    Ahh. Yes, I understand your need - we do it the same way with linking PDF jobaids and websites. We always open in a new window because we don't want the user to inadvertently close the window that contains the link to the LMS.

    I vaguely recall reading or someone telling me that I couldn't control what opens in a tab or new window because it is all based on the user's configuration - but I've been wrong before.

    Once I have a chance, this week I will try to create a dummy module in an AU and publish to my LMS for testing and send you that package.
    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • rwvaughn
    rwvaughn Community Member Posts: 9 ♪ Opening Act ♪

    Okay, here are three URLs. None will open the same using the Go To Web Address > New > Window (Default settings). These links are in the same text box.

    https://www.samhsa.gov
    https://www.cdc.gov/niosh/topics/respirators/
    https://www.cms.gov/Regulations-and-Guidance/
    Legislation/CLIA/Downloads/ppmplist.pdf

    Try them by setting the size of the new window (800 x 600) in both Run and Preview in Browser modes, and then see the results in IE, Chrome and Edge. It will be fun.
  • mspencer-2813
    mspencer-2813 Community Member Posts: 14 ☆ Roadie ☆
    I have also noticed that when testing in SCORM Cloud, a .gov hyperlink refuses to open from within Lectora 19, but the same link does open in a different authoring tool.

    This sounds like a Lectora-specific issue, and I hope it is addressed in a future update so that we don't have to start building more of our courses with other authoring tools just because of a hyperlink problem.

    If there is an HTML Extension/ JavaScript workaround for this in the meantime, it would be greatly appreciated. It needs to open the link in a new window, not a tab, otherwise our LMS admins will not accept the course.
  • mspencer-2813
    mspencer-2813 Community Member Posts: 14 ☆ Roadie ☆
    edited August 13, 2021
    I think I found a solution, but I hope eLearning Brothers takes this into consideration for future updates so that this solution doesn't get "broken" somehow (at least not without providing a clear, functional alternative that's easy to implement).

    If you create a button and use the window.open() JavaScript command, and make sure to set specific parameters for height and width, the link should open in a new window. This worked for a couple of .gov sites that I tested. The "Run JS action" is only available for buttons. You can't do this with simple hyperlinks in text boxes.

    More about window.open() can be found here. I'm nowhere close to being fluent in JS, but I came across this site while researching this issue after a colleague brought it to my attention.
  • jholland
    jholland Rockstar Manager Posts: 35 eLearning ROCKSTAR Admin Team

    I vaguely recall reading or someone telling me that I couldn't control what opens in a tab or new window because it is all based on the user's configuration - but I've been wrong before.

    Yes, if the user has set their browsers to open new windows in a tab, this user desire is respected by the course created by Lectora. Opening in a separate window was easier years ago, but browsers have become more controlling in recent years.

  • jholland
    jholland Rockstar Manager Posts: 35 eLearning ROCKSTAR Admin Team

    If you create a button and use the window.open() JavaScript command, and make sure to set specific parameters for height and width, the link should open in a new window.

    Yes, you can do this with custom javascript and the window will usually open as a true window. For your first link in the post above, the following code should open a window, and not a tab if the user has their browser set to open new windows in a tab:

    window.open("https://www.samhsa.gov", "", "width=600,height=400");

    The user still might thwart this attempt by having pop up blockers enabled, this might vary by browser and the strength of the pop up blocker.

    This worked for a couple of .gov sites that I tested. The "Run JS action" is only available for buttons. You can't do this with simple hyperlinks in text boxes.

    Lectora authors will sometimes place a transparent button over the text that looks like a hyperlink. Then when the user "clicks on the hyperlink", the action on the button performs the desired action.

    Thanks for posting this information.