+ Reply
Results 1 to 13 of 13

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Icon to launch a web app - force it to open in an existing Safari window?

is a discussion within the

3rd Party Apps Requests

forums, a part of the

3rd Party Apps For iPhone | iPod Touch

section;
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
...
  1. #1
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    Default 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.

    No one?
    Last edited by HotStuff2; 12-10-2007 at 05:25 AM. Reason: Automerged Doublepost

  2. #2
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    Anyone? Someone? NO ONE has any ideas, thoughts, comments, or suggestions on this?

  3. #3
    Green Apple
    Join Date
    Aug 2007
    Posts
    36
    Thanks
    0
    Thanked 10 Times in 4 Posts

    I've just slapped together a site-specific browser that could become exactly what you're looking for (probably isn't now, though).

    http://modmyi.com/forums/showthread.php?t=22449

  4. The Following User Says Thank You to lh99 For This Useful Post:

    Broomhead (12-25-2007)

  5. #4
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    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.

  6. #5
    Moderator Admin Broomhead's Avatar
    Join Date
    Sep 2007
    Location
    Outside Chicago IL
    Posts
    17,147
    Thanks
    502
    Thanked 1,717 Times in 1,170 Posts


  7. The Following User Says Thank You to Broomhead For This Useful Post:

    jimsjim (12-25-2007)

  8. #6
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    Quote Originally Posted by Broomhead View Post
    No.

    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.

  9. #7
    Moderator Admin Broomhead's Avatar
    Join Date
    Sep 2007
    Location
    Outside Chicago IL
    Posts
    17,147
    Thanks
    502
    Thanked 1,717 Times in 1,170 Posts

    OK Then You wait here and I'll go look for you
    Last edited by Broomhead; 12-25-2007 at 09:42 AM.

  10. #8
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    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.

  11. #9
    Green Apple
    Join Date
    Aug 2007
    Posts
    36
    Thanks
    0
    Thanked 10 Times in 4 Posts

    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. #10
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    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...

  13. #11
    Green Apple
    Join Date
    Aug 2007
    Posts
    36
    Thanks
    0
    Thanked 10 Times in 4 Posts

    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.

  14. #12
    iPhoneaholic HotStuff2's Avatar
    Join Date
    Nov 2007
    Location
    Tampa Bay, FL
    Posts
    344
    Thanks
    5
    Thanked 22 Times in 17 Posts

    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.

  15. #13
    Green Apple
    Join Date
    Aug 2007
    Posts
    36
    Thanks
    0
    Thanked 10 Times in 4 Posts

    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!

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts