Safari blocking popups - javascript

I have a twitter sign in, it's known that Google and Facebook have their own script for opening sign in popup and it somehow works even on Safari, but twitter doesn't. So we implemented our own, the issue we face is that IOS devices are blocking popup opened with:
window.open(url, '_blank', 'height=400,width=800,left=250,top=100,resizable=yes', true);
I've also tried creating an anchor tag after reading (Bypassing popup blocker in safari):
<a id="js__twitter__popup-link" target="_blank" style="visibility: hidden;"></a>
Then we add url to href this.twitterPopupLink.setAttribute('href', url), then document.querySelector("#js__twitter__popup-link").click(), but on IOS it won't open a new page even that way.
Tester said that on iPad popup is opened but using IOS emulators it didn't open for me on iPad. It's a sure thing that it doesn't open popup on iPhone through.

on IOS it won't open a new page even that way
Correct. The point of a popup blocker is to prevent popups. Any workaround you can imagine they've probably also imagined and prevented.
In general, you can only open a popup window in one scenario - immediately after a user-initiated click. Triggering a click via JavaScript won't bypass this.

Related

In all ios devices and safari browser, open in new tab redirects to base url, not redirecting to expected route (Angular)

I am trying to open a route in new tab by using window.open.
In all ios devices and safari browser, open in new tab redirects to base url, not redirecting to expected route (Angular). Not even working with window.open
I tried with anchor tag with target=_blank but gives same issue.
window.open(this.getRoutePrefix() + '/new-page', '_blank', 'noopener');
I experienced the same issue when trying to open a link with "window.open()". Does it work with Firefox (Desktop) for your? If your Firefox thinks that your link is a popup (as in my case), Safari might think that, too. In my case, I disabled popup blocking in the iPhone's Safari settings, and that solved it.

Switching tab on iOS mobile browser is not working via a href target or even window.open window focus

I've been working on this for 1 week, but no luck I can't find any answer on this.
I want to switch tab on my browser iOS mobile via javascript or html, I tested it in all browser in mac and android, it's working as expected. But in iOS mobile it's not working. I saw some articles that I need to disable popup blocker which I did.
I tried simple way like
go
this will just create new window but when I clicked it again it doesn't switch to this tab
const newWindow = window.open(href,"custom_name")
same thing happens in here.
I also tried
newWindow.focus()
nothing happens
I read there's an article that iOS blocked the popup new window for security policy, not sure if this switching of tab is also included in that policy.
Is there a way to do this?

Firefox addon: Window.open() vs CTRL-N

I created a simple firefox add on using addon-builder that installs & successfully appears in the add on toolbar at the bottom of the browser.
If I press ctrl-n, open new tab, open new window, or open private browsing window in firefox, then I see and can use my addon. However, if another site programmatically opens a window using window.open(), then my addon doesn't appear.
Is this by design? Or is there a setting that I can include in my addon so that it always appears, even if the window was opened through window.open() instead of ctrl-n?
When sites open with window.open, they specify which parts of the browser UI will show. You may be able to place it somewhere less likely to be removed, like the navigation toolbar. The add-ons toolbar sounds like it's going away soon, anyway.

Issue with popups in IE10

All -
We have surveys on our website, which opens a popup on window unload. The JavaScript code to open the popup is as follows
window.open(URL,'testpopup','toolbar=no,personalbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=775,height=565,screenX=1,screenY=1,top=1,left=1')
The issue is in IE10, when the popup opens in a new tab. The popup has two options 'accept' and 'decline'. When the user clicks on 'decline', it is crashing the entire browser. Here is the close code. I did not see this behavior on my computer, but lot of users have reported this issue
Decline
Could anyone suggest what the issue could be?

How to get Chrome to open multiple sites in a new tab

I'm developing a tool that lets you open multiple pages at once with a shortcut, to be used for things like opening your daily sites or querying multiple search engines for a phrase. In Firefox, Internet Explorer and Opera, assuming you've unblocked pop-ups for the domain, the code works as expected.
Chrome, however, opens the sites in new windows instead of tabs if the links are opened automatically when the page loads. If openAll() is commented out and the button is clicked or a key is pressed, the pages open in tabs. Note it's calling the exact same function.
The best solution I've found (which isn't saying much) is the One Window extension. It works, but you can see the new window open then get sucked back in, and it keeps you from opening new Windows with Ctrl-N, forcing you to drag tabs out to use another Chrome window.
I can understand there not being a programmatic way to change this because it's a browser setting, but as a user of the tool it's annoying to have the sites all open in new windows. Is there a Chrome setting or extension that will open links in tabs when they're loaded without user input? I realize opening a bevy of windows is the very thing browsers aim to stop, but this is one time where I want to allow it.
<input id="openAllBtn" type="button" value="Open all links"> (Or press any key)
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
function openAll() {
window.open('http://yahoo.com/');
window.location.replace('http://www.bing.com/');
return false;
}
$(document).ready(function() {
$(document).bind('keypress', openAll);
$("#openAllBtn").bind("click", openAll);
openAll();
});
</script>
Here's a Fiddle of the code: http://jsfiddle.net/sfzjR/
Is there a Chrome setting or extension
that will open links in tabs when
they're loaded without user input?
Check out the create method in the chrome extension docs. By default it will open a new tab, you can optionally specify the window you want that tab to open in, and give the tab a url.

Categories

Resources