Search code examples
javascriptsafarimobile-safariwindow.open

window.open always opens new tab in Mobile Safari for iPad


My company is using Karmasoft's UltimateEditor to allow for rich text in textarea fields as well as the ability to spellcheck.

An issue we have run into is that on Safari for the iPad, the spellchecker is opening in a new tab instead of a new window on top of the current window.

I have tried looking at the Safari settings to see if I could find a "Open pages in tabs instead of windows" setting, which exists in Safari for Windows, but I can't find a similiar setting for Safari on the iPad.

I asked on http://apple.stackexchange.com, and the basic answer was that this is just how it works in the iPad because "There is no concept of windows in Safari for iOS, so a new tab is all you get"

Has anyone else experience this problem, and have they found a way around it? The UltimateEditor plugin uses window.open() to open the spell check window.


Solution

  • That's how mobile safari works. You can't open a "mini window" like you can in a non-mobile environment.

    What you can consider doing is overriding the window.open function to instead open a div with an iframe in it. How that will propagate down and affect the editor, I don't know. You also have the option of trying to override the editor's method of pulling up the spellchecker directly if that's easier. I've taken both routes and, depending on the component, each path can be easier than the other. It just really depends on the component you're editing.

    See this SO thread for an example of overwriting window.open: How to override the window.open functionality?

    I realize this isn't the straight forward answer you were probably looking for, but having done this before I think it's going to be the path you'll have to take. Either override window.open or start modifying the editor object directly. Or option three, find another editor.