Stop Mozilla Firefox opening popups in a new tab - javascript

I am building a site which when you click a link it opens up two things; it opens up a pop-up and an external website in a new tab. This is so the user can interact with the pop-up whilst he/she browses the external webpage.
This was working fine for me but I think when my FF updated to version 15.0.1 on OSX lion, I can no longer get this to behave the way I want it to.
I have even changed the settings in FF: FF->Preferences->Tabs->Open new window in Tab instead to off and with no such luck.
I have also noticed that facebook connect on any site will open a new tab rather than a new pop-up too.
I can't seem to find any documentation on the web stating that this is FF's native behavior, even in their changelog.
Here is my javascript trigger which I am certain all the parameters are correct:
popWin = window.open('http://somesite.com','myTargetWindowName','height=650,width=450,pageXOffset=900,pageYOffset=900,scrollbars=yes');

Related

How can I stop Chrome blocking me setting a window.location after the user has changed the URL?

I open a new window to point at a page in a manual with var manual_win = window.open("", "manual");
I then set the location (after a bit of async code that tests the existence of the page) with manual_win.location = url;
This works and opens the manual page in a new named tab. I can later run the same code with a different URL and it works fine.
If the user edits the URL manually on the named tab to be some other site such as google.co.uk then the code no longer works on Chrome 76. It just brings the tab to the foreground and doesn't change the location. There is no issue with Firefox. I presume this is due to some sort of popup blocking logic in Chrome.
Is there any way to get around this?
It seems like a bug in Chrome that it blocks me from changing the location yet still brings it to the foreground. It would have made more sense for it to have cleared the name from the tab when it took control way from me so I end up opening a new tab instead.

Xrm.Utility.openwebresource opens new tab

We have an onprem crm 2016. I'm opening an html webresource on a click of a ribbon button. I'm using Xrm.Utility.openWebResource(...). The problem with that is we're using IE11 and all users' browsers are configured to let IE decide how to open pop ups.
Guess what, IE decides to open a new tab! Is there a way to open an html web resource in a new window without changing the users' browser options?
Xrm.Utility.openWebResource() performs different in Chrome compared to IE11. Below options are there, pick it what suits you.
window.open()
Unsupported way to open modal dialog - showModalDialog
Xrm.Internal.openDialog()
Source
Xrm.Utility.openEntityForm() has an option to mention as openInNewWindow = true in parameter windowOptions which is not available for openWebResource()

Can't open new tab in JavaScript why? Do I need HTTPS?

When I try to open a new window using:
window.open('url?params','_blank')
it's treated as a popup.
Tried with this to:
<a hred='url?params' target='_blank'>Test</a>
same result.
Tested it on Chrome and Edge.
My site isn't marked as "Secure" in the browser. Does it have to be marked as Secure (HTTPS), to be able to open new windows?
The problem is not with your site being Secure or not.
The thing here is with browsers. They are designed to block new tab or new window as pop ups if they have not being effected/caused form a trusted event. That means the user has to actively click somewhere to open a popup or some submission has to happen to allow the pop up.
The answers from here and here should give you better insights.

Open URL in same window from different tabs

Let's say I have this function in a javascript on my web page that loads a url from an textfield with id url:
function loadUrl()
{
var url = document.getElementById('url').value;
window.open(url, 'urlwindow');
}
If I open two tabs in my browser and opens my web page in both tabs, I want both tabs to open the url in the same window, not two separate windows. Is this possible?
In other words, I want to target window opened from another tab.
You can't control the behaviur of the user's browser: just add as target windows "_blank" and hope your user have enough recent web client that opens a new tab and not a new window.
In my experience, this works perfectly (and just like you're trying to do it) with Firefox and IE, but not with Chrome or Safari.
Firefox and IE seem to use domain-specific namespaces for target names, while Chrome and Safari seem to use browser tab-specific namespaces for target names, so in these two browsers, 'urlwindow' as seen from tab A is different from 'urlwindow' as seen from tab B.
I'm trying to find a workaround for this myself, but have not yet been successful. See Chrome/Safari: how to open the same window from different tabs or windows

javascript : window.open

I am working in vb.net 2005. I am in a position to start a new browser with process.start().
Now I have to open that browser in a specific size(say height:300 width:500)
Process.Start("firefox.exe", "abc.html")
and I have written this following code on load of abc.html
var myRef = window.open('abc.html','','left=20,top=20,width=300,height=500');
but it does not resize.
If I add 1 button on this page and click on it (by writing same code on its click event), a new window with expected size opens.
Am I going wrong somewhere?
Thanx.
Firefox doesn't let pages resize the window by default. Also note, if you already have Firefox running then browser preferences will dictate whether you get a new window or a tab. You can force a separate instance of Firefox by using the -no-remote command line flag, but then you won't be able to use the default profile (only one Firefox instance per profile).
My questions for you are:
Why are you launching Firefox from another executable at all instead of just having users click on a link and have it open in their default browser?
If you do need to launch Firefox from an executable, why spend all this effort overriding the user's preferences and settings?
If you' re launching from an executable and are keen to annoy your users whatever the cost, why not just find and resize the Firefox window using the normal Windows APIs?

Categories