cancel
Showing results for 
Search instead for 
Did you mean: 

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

Highlighted
New User

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

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

3 REPLIES
Site Moderator

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

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.

New User

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

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 !!!

Site Moderator

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

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+