Popup issue on iPad - javascript

I have observed an issue or what seems like a bug on iPad Safari.
Basically I have a link to open a popup using the normal window.open() Javascript method. Now this works fine most of the times on iPad Safari, but on a few instances, it opens the child page in the same window (rather than a separate child window)
It happens once in like 25 tries.
Please let me know if this is a known iPad issue OR if you have observed this inconsistent behavior with popups on your pages.
Thank you.

Related

window.focus() does not work for existing tabs in ALL IOS browsers

I'm trying to create a "re-launch" button that should bring the user to an existing opened tab. So far, this is how it's implemented:
Using window.open() initially to create the tab and focusing to that tab using window.focus().
The relaunch button should basically call window.focus() and redirect to that tab.
This has been asked in $window.focus() doesn't work on existing tabs in iOS Safari but I'd like to get a more general overview on this question. I've looked everywhere but I couldn't find any lead to this question.
Apparently, it works in android browsers but I can't get it to work in ios browsers (safari, chrome). Does anyone have any clue about this issue?
This seems to be a bug in iOS browsers. As a workaround you may replace
focus() by a sequence of close() and open(...).

Chrome extension equivalent for firefox add-on sidebar

I am trying to create chrome extension that will create floating overlay (static one that dose not refresh), Similar to firefox add-on "ui sidebar"
Is there any way to maintain iframe like overlay that wont be effected by the page, and wont be reloaded when the tab reloads.
The simple answer is NO.
What you are describing is basically called browser chrome, i. e. UI. The only chrome Google Chrome extensions support since forever are page actions and browser actions.
Opera also supports sidebar actions. Rumor is, Firefox WebExtensions will support that too.
Chrome has no support however. It's on the wishlist but has no actual proposal/intent to ship. Apparently, there has been a recent decision not to pursue this.

Safari and window.open() -- how to use it and not get focus?

My order entry web site is being enhanced to have a Master / Child window architecture. The Child windows would be used for "by the way..." searches and the Master window is where editing occurs. Periodically the Master window wants to tell things to the Child windows. If it has a handle to the child, such as that from window.open(), then this is easy.
Because the user might refresh the Master window (F5) the page must recover its list of children. I don't know of a way of doing this apart from going through a list of likely child window names using window.open(). Tests of this idea on my computer running Windows, with the Chrome / Firefox / MSIE browsers, all work OK.
However, I don't get good Safari results. When run on a variety of Mac OS / Safari versions calling window.open() always also brings that window to the foreground. To me this is deal-breaking behavior. Running window.open() then window.blur() isn't acceptable due to the flash display of the undesired window.
Question: Is there a way of calling window.open() (and not window.blur()) while always suppressing the "bring to foreground" behavior?
Question: Are there ways of getting a window handle w/o using window.open()?
Thanks,
Jerome.
window.opener would be the answer for your question. But window.opener is not supported by IE.
something like below would help.
if ($.browser.safari)
std = window.opener("", "childwindowname");
else
std = window.open("", "childwindowname");

Closing child windows onunload event in javascript

I am working on a project that has an onload event of
var opsWin = window.open ('url','_blank', 'options);
var preWin= window.open ('url','_blank', 'options);
var pkgWin= window.open ('url','_blank', 'options);
var apcWin= window.open ('url','_blank', 'options);
opsWin.focus();
preWin.focus();
pkgWin.focus();
apcWin.focus();
These popups displays 4 different PDFs that the user needs to see before proceeding. My problem comes on my onunload event:
function unLoadDocs(){
alert(opsWin)
opsWin.close();
preWin.close();
pkgWin.close();
apcWin.close();
}
My alert is for debugging purposes, to make sure I make it there and to see that opsWin actually exists(it does make it there and it does exist and in scope). My problem is that the documents are not closing in Internet Explorer 10. I try the same script in Mozilla Firefox, and it works perfectly.
Some insight as to why these windows won't close on Internet Explorer 10 would be great.(I have also tried IE9 with no success)
The popups were PDF's, so adobe reader was holding it open/had a different handle. Ultimately, I opened another window with a 100% width and height i-Frame and embedded the PDF in the i-Frame. I was then able to close the windows with the unload function above.

iPad Safari Popup issue

On iPad Safari, there seems to be issue with popup. When a popup (opened using window.open()) is closed, it remains in minimized mode (or grid view) after closing the popup...It
does not return focus to the parent window.
I have tried using parent.opener.focus(), but still does not work.
Is this a known iPad issue OR can we fix this issue using some JS code?
Please help.
I'm not sure if this would help, but just some personal experience on this issue:
Did you try going to iPad's Setting - Safari - Block Pop-ups? Try turning off Block Pop-ups, it should work.
If it still doesn't appear, try turning on the Debug Console for the ipad and check if any error appears during the popup event.
Try using a URL for window.open to be a local / same domain url address. I think that works (without needing to turn off the popup blocker in safari ipad).

Categories