X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

Failure to open links using window.open (applies to FF17 and FF18, works ok with FF16 and below)

Posted

Hello,

As mentioned, this only started happening with FF17, and repplicated with FF18. FF16 tested ok, and below.

This is the HTML code involved:

<a target="resource11" onclick="this.target='resource11'; return openpopup('/mod/resource/view.php?inpopup=true&amp;id=43','resource11','resizable=1,scrollbars=1,directories=1,location=1,menubar=1,toolbar=1,status=1,width=620,height=450');" href="http://myschool.education.loc/lms/mod/resource/view.php?id=43">

Notice the call to openpopup() function, which has this code:

function openpopup(url,name,options,fullscreen) {
  fullurl = "http://myschool.education.loc/lms" + url;
  windowobj = window.open(fullurl,name,options);
  if (fullscreen) {
     windowobj.moveTo(0,0);
     windowobj.resizeTo(screen.availWidth,screen.availHeight);
  }
  windowobj.focus();
  return false;
}

When clicking on the link on FF 17/18, I get this error and the popup does not open:

Error: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]

Seems like a bug?

Thanks

Modified by cor-el

Additional System Details

Installed Plug-ins

  • Shockwave Flash 11.5 r502
  • The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
  • Next Generation Java Plug-in 10.10.2 for Mozilla browsers
  • ActiveTouch General Plugin Container Version 105
  • iTunes Detector Plug-in
  • Facebook Desktop Plugin
  • Google Update
  • Adobe PDF Plug-In For Firefox and Netscape 10.1.4
  • VLC media player Web Plugin 2.0.2
  • 4.1.10329.0
  • The plug-in allows you to open and edit files using Microsoft Office applications
  • Office Authorization plug-in for NPAPI browsers

Application

  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0

More Information

cor-el
  • Top 10 Contributor
  • Moderator
10778 solutions 97004 answers

A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.

webshaker 0 solutions 1 answers

Helpful Reply

I have the same problem and this is not a web development problem.

window.open works into every browser for more than 10 year except witgh firefox 18 !!!

cor-el
  • Top 10 Contributor
  • Moderator
10778 solutions 97004 answers

Helpful Reply

Do you have a real working page with this code?

I do get a pop-up/tab opening with your code, get a server not found error.

Start Firefox in Safe Mode to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).

  • Do NOT click the Reset button on the Safe mode start window or otherwise make changes.

<a target="resource11" onclick="this.target='resource11'; return openpopup('/mod/resource/view.php?inpopup=true&amp;id=43','resource11','resizable=1,scrollbars=1,directories=1,location=1,menubar=1,toolbar=1,status=1,width=620,height=450');" href="http://myschool.education.loc/lms/mod/resource/view.php?id=43">click this link</a>
<script>
function openpopup(url,name,options,fullscreen) {
  fullurl = "http://myschool.education.loc/lms" + url;
  windowobj = window.open(fullurl,name,options);
  if (fullscreen) {
     windowobj.moveTo(0,0);
     windowobj.resizeTo(screen.availWidth,screen.availHeight);
  }
  windowobj.focus();
  return false;
}
</script>

data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxhIHRhcmdldD0icmVzb3VyY2UxMSIgb25jbGljaz0idGhpcy50YXJnZXQ9J3Jlc291cmNlMTEnOyByZXR1cm4gb3BlbnBvcHVwKCcvbW9kL3Jlc291cmNlL3ZpZXcucGhwP2lucG9wdXA9dHJ1ZSZhbXA7aWQ9NDMnLCdyZXNvdXJjZTExJywncmVzaXphYmxlPTEsc2Nyb2xsYmFycz0xLGRpcmVjdG9yaWVzPTEsbG9jYXRpb249MSxtZW51YmFyPTEsdG9vbGJhcj0xLHN0YXR1cz0xLHdpZHRoPTYyMCxoZWlnaHQ9NDUwJyk7IiBocmVmPSJodHRwOi8vbXlzY2hvb2wuZWR1Y2F0aW9uLmxvYy9sbXMvbW9kL3Jlc291cmNlL3ZpZXcucGhwP2lkPTQzIj5jbGljayB0aGlzIGxpbms8L2E+CjxzY3JpcHQ+CmZ1bmN0aW9uIG9wZW5wb3B1cCh1cmwsbmFtZSxvcHRpb25zLGZ1bGxzY3JlZW4pIHsKICBmdWxsdXJsID0gImh0dHA6Ly9teXNjaG9vbC5lZHVjYXRpb24ubG9jL2xtcyIgKyB1cmw7CiAgd2luZG93b2JqID0gd2luZG93Lm9wZW4oZnVsbHVybCxuYW1lLG9wdGlvbnMpOwogIGlmIChmdWxsc2NyZWVuKSB7CiAgICAgd2luZG93b2JqLm1vdmVUbygwLDApOwogICAgIHdpbmRvd29iai5yZXNpemVUbyhzY3JlZW4uYXZhaWxXaWR0aCxzY3JlZW4uYXZhaWxIZWlnaHQpOwogIH0KICB3aW5kb3dvYmouZm9jdXMoKTsKICByZXR1cm4gZmFsc2U7Cn0KPC9zY3JpcHQ+