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.
Related
I am using software that creates all the HTML/XML so I don't have this and I have created a button to open a form in a new window. When I physically click on this button, everything works. However when I run the code onload, I get a message saying that the page is blocked and I need to remove any popup blocker
var button = getElement("GUID_of_Button");
button.click();
This code works if I set to open the form in the same window as a tooltip but not as a new window. I tried on Chrome, Firefox and IE with same results. (no console error)
Not sure if this helps (get this when I inspect element)
<input name="buttoncontrol0F09F8F7" id="ID_buttoncontrol0F09F8F7" value="Click here" type="submit" title="Click here" class="Button_Standard" style="cursor: pointer;">==$0
Naturally I can remove any blockers but as this is for the whole office, I can't ask everyone to do this just so I can get this to work. Any advise is appreciated.
This is a feature of modern browsers that restricts the opening of new windows to user-initiated actions.
This is important as it mitigate security risks and gets rid of the most obnoxious advertising.
Unless you can get everyone to change their browser settings, you won't have a new window opened automatically.
Depending on the data you need to display, you could consider alternative to new windows such as modals / pop-ins. Take a look for example at Bootstrap's modal.
Popup windows are generally used for advertisement and these windows will be opened without permission of user. Inorder to prevent this, most of the web browsers comes with popup blockers which should be explicitly configured by user if they want to automatically open something in a new window.
If you want to use this featue, you'll have to ask users to configure popup blockers in their web browser.
I am noticing that my share popups are being blocked on our application but not others.
Here is the code execution:
1.) User enters web page.
2.) User clicks on facebook or twitter or googleplus share icon
3.) Onclick event passes the request to an internal controller that saves some information and then redirects back to the originating webpage. This time, however, there is a request parameter that invokes the usage of opening a new window.
The code I have that invokes opening a new window is (for this example we will use facebook):
var url = 'https://www.facebook.com/sharer/sharer.php?u='+copyLink;
window.open(url,'newwindow','width=600,height=600');
Now, if i enable popups it works fine. The problem is the user has to enable popups every time.
Is it a server issue? What is the reason why on other apps they don't have blocked popups but for OUR APP we cannot use popups without enabling popups
Any help would be greatly appreciated.
From what I understand, your application attempts to open a popup window following a page load. The nytimes.com popup appeared in response to a mouse click.
There is an important difference between these two ways to open a popup: the latter follows a user-initiated action but the former does not. As a result, popup blockers will generally block the former but not the latter. A lot of users wouldn't be too surprised if a popup opened when they clicked a button, but they would be more irritated if a popup appeared when a page loaded. The fact that your popup was ultimately triggered by an action on another page doesn't matter - what happens if you manually add to the URL the extra parameter that opens the popup?
Here's an old page on MSDN on popup blockers. It may describe the popup blocker in IE6 (of all browsers), but I think it still provides a reasonable explanation of when popup blockers typically permit or block popups.
Would it be possible to open a popup for your share dialog before calling back to the server? I would expect that opening a popup in the onclick handler would work without needing to explicitly allow popups.
Hi I have set up a task in my task scheduler to login to my UTM by opening a firefox window at regular intervals. When the relevant URL is loaded a auto-login GM script works on it and logs me in to UTM.
I would like to close that tab after the login is done. If I use
window.close();
It works fine but if no other tab is opened at the time, it simply closes the window.
Without going into details of UTM I would like the following -
A GM hack which closes the tab only if other tabs are already open. If it is the last tab of the window, then it should just replace it with a blank tab (so that window is not closed).
Probably GM cannot obtain any info about the other tabs, but is there any hack ?
As far as I'm aware this isn't possible, if nothing else then for security reasons: you don't spam javascript from your video streaming tab collecting all your data and submitting forms on your behalf.
Here's a thread with a solution that worked for IE7 that you may be able to manipulate but as I said it's not likely.
If you decide to have ago, don't think about identifying the number of tabs, it won't happen, instead focus on determining whether or not there are multiple tabs.
The linked example uses if(clientY == 0) to determine whether or not the browser is closing. This would be a good starting point.
Again, for security reasons, you won't be able to find out information about open tabs.
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');
I'm developing a Google Chrome extension with a popup (it's a browser action), and it changes the location of the page, which makes the popup disappear. How can I make it stay between page reloads?
You can't. browserAction popups are closed on any activity outside of the popup. You could potentially use Desktop Notifications though.
You'll need to use Background Page, and pull information from it every time you load the popup. Background pages run whether or your extension is currently being used or not.
Not sure if this helps, but from the FAQ:
Can extensions keep popups open after the user clicks away from them?
No, popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away.
I had to implement a workaround for this as well. In my case, I was trying to use auth0's loginWithPopup. When the popup closed, it returned focus to the chrome window instead of the extension which caused the extension to close before authorization fully completed. I worked around it by opening a new window which acts as a barrier of sorts to prevent chrome's focus from going back to the window the extension was opened from. Anyway, just wanted to put it out there in case it helps someone in the future.