Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
12-10-2007, 05:25 AM #1
Icon to launch a web app - force it to open in an existing Safari window?
I asked this in another thread, but it got buried, so I thought I'd create it's own thread...
Here's something I'm trying to figure out: is there a way to name the window that's opened in Safari, so that if, say, you launch BeeJive, log in, then go back to the Springboard, and click the icon again (which would launch another instance of BeeJive in a new Safari window), it simply pulls up the window already open?
If you don't do that, the web app launches in a new window, and in my BeeJive example, you wouldn't see any messages you'd received unless you close the new window and go back to the one previously launched.
Last edited by HotStuff2; 12-10-2007 at 05:25 AM. Reason: Automerged Doublepost
12-22-2007, 08:29 AM #2
Anyone? Someone? NO ONE has any ideas, thoughts, comments, or suggestions on this?
12-23-2007, 11:10 AM #3
The Following User Says Thank You to lh99 For This Useful Post:
12-23-2007, 12:51 PM #4
Yeah, that's not what I'm looking for. I'm trying to find a way when you use an icon on the Springboard to launch a website.
12-23-2007, 12:54 PM #5
The Following User Says Thank You to Broomhead For This Useful Post:
12-25-2007, 08:00 AM #6
Please READ my original first post.
My question is NOT "how do I add a link to a website on the Springboard". THAT is easy, THAT I've done.
My question is: is it possible to NAME the window that's opened, so if someone starts a webpage, then goes back to the Springboard and launches it again, it will open in the window ALREADY opened, instead of opening ANOTHER window in Safari.
12-25-2007, 08:59 AM #7
OK Then You wait here and I'll go look for you
Last edited by Broomhead; 12-25-2007 at 09:42 AM.
12-25-2007, 10:32 AM #8
Dude, I *have* looked everywhere. That's why I finally posted here asking if anyone has any ideas. AFAIK and can tell, there's no setting to name a window in the PLIST.
12-25-2007, 11:37 AM #9
You're right, I don't think there is a way to do exactly what you want, not without modifying MobileSafari, at least. There's a remote possibility, check this out. But even if you could tell MobileSafari to go to a specific tab, you'd need some way to tell which tab holds the page you want, keeping in mind that some tabs may have been closed since the last time the page was launched from SpringBoard.
Did you take a close look at my SignalClient solution? It's just a one-window web browser that opens a pre-defined site directly from SpringBoard without using MobileSafari. So, using my app, you could create a separate browser for each of your frequently used sites and put each one on SpringBoard in place of the iPhone Apper-style Safari "links" you have now. It could even be programmed to automatically log-in for you as well so you never have to type a password.
Obviously, the app needs work (getting the keyboard working, a preferences page would be nice, and some kind of page caching would be needed so that the site doesn't need to be reloaded every time you tap the icon on SpringBoard), but all of this is totally doable. I may give it a shot if some better programmer than me doesn't run with this idea.
12-25-2007, 06:31 PM #10
I suspect that once the SDK is released, we'll have a lot more info about MobileSafari, as well as the iPhone in general. Might have to wait until that happens. Naming windows is a basic HTML command; Safari supports it, and respects the standards "_self", et. al, and custom-named windows. I created a few test pages and named them different things, then opened them in MobileSafari, and it does correctly remember which one is which and opened the links appropriately, without creating a new window.
Now, I want to figure out is what command needs to be in the PLIST to name a window, so that if MobileSafari is called from the Springboard, it always opens in the same window.
I tried looking at the info.plist for MobileSafari, but it's not readable (probably needs to be converted), and there's a Developer.plist that's the same way. I've tried the online converter that's supposed to do that, but it never seems to work for me. And I can't rememer the URL anyway. I found an already-converted info.plist file; nothing in it to suggest a naming convention for windows, so perhaps it's in the developer.plist, or completely absent...
12-27-2007, 06:12 AM #11
The PLIST files are readable, you just need the right editor. I wouldn't bother though, there isn't anything useful in there. Developer.plist just provides some controls for MobileSafari's debug window as far as I could tell.
The method (currently) used to open a website in MobileSafari from Springboard is [self openURL:baseurl], which inherits from the UIApplication class. OpenURL/Apper are just applications that open, execute this command, then terminate. Despite the lack of an SDK, the application framework is fairly well documented, and I have searched for alternative methods of opening a page in Safari with no results. openURL does not take arguments other than the boolean asPanel, which does not appear to be useful. So as I said, without modifying MobileSafari in some way (maybe a plugin?), I don't think this is possible. There is not a way to specify a target for the link from an outside application.
What you need to do is get your target information into MobileSafari first, then open the link in the appropriate window. A locally-hosted webpage running PHP could do this. Basically, I'm thinking of a tab manager site that you could send messages from Springboard using POST or GET that include the URL you want to open and the target window name. The PHP site would create and open the appropriate HTML link with the specified target, then close itself. Not ideal, I can't think of another option given the current toolset.
12-27-2007, 09:37 AM #12
Well, crap....that's sorta what I thought. Perhaps the SDK will shed some light on it, but I'm not holding my breath on it.
12-31-2007, 08:50 AM #13
Looks like this may be solved for us in 1.1.3. In the Gear Live video I just watched, it appears that the new bookmark on home screen feature does not open a new window if the bookmark is already open, but just displays the previously loaded page. Guess we'll see!