JavaScript window.open Not Working in Firefox

JavaScript window.open Not Working in Firefox

Are you trying to open an URL using the JavaScript window.open() method but it is not working in the Firefox browser? Then you can use the below simple trick to resolve this issue.

The issue happens in the Mozilla Firefox browser because it is expecting a return value from the JavaScript function which is not being returned. So it shows the [object window] message in the previous tab from which the new tab is being opened using the window.open() function.

To solve this issue, use void() function over window.open() function. Below is an example:

void(window.open('https://www.oracle.com', '_blank'));

If using javascript: keyword, like most we do in Oracle Apex, then check the below example:

javascript:void(window.open('https://www.oracle.com', '_blank'));