Title: Menu Items Opening Browser Window
Last modified: August 31, 2016

---

# Menu Items Opening Browser Window

 *  [Ryanio](https://wordpress.org/support/users/ryanio/)
 * (@ryanio)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/)
 * Hi,
 * I have received the IOS and APK for my site. However in the app when tapping 
   a menu icon, the links are opening in a browser window rather than in the app.
 * Please help this is urgent!
 * Thanks in advance
 * [https://wordpress.org/plugins/wordapp-mobile-app/](https://wordpress.org/plugins/wordapp-mobile-app/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Bj123](https://wordpress.org/support/users/bj123/)
 * (@bj123)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237422)
 * Same issue here. I am using my own mobile theme so I don’t expect it to be like
   a native app but it simply opens up Safari and loads all pages there on all menu
   items. So theres is not much app left. In addition it shows 62 warning messages
   while loading a test app image on my iPhone and doesn’t trigger a push notification
   message that you normally get before you allow push to receive. Please advise.
   Thanks.
 *  Thread Starter [Ryanio](https://wordpress.org/support/users/ryanio/)
 * (@ryanio)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237425)
 * Same here, I have published two apps now and both have had 60+ error warnings
   and some errors which prevent the app from launching. It took extensive googling
   to fix the problem seeing as I know nothing about objective-c.
 *  Plugin Author [Dave Anthony](https://wordpress.org/support/users/mobilerockstar/)
 * (@mobilerockstar)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237514)
 * Hi there,
 * They are not errors they are Warnings in Xcode. Although they are thing that 
   are being fixed your app will fully work as they are notes to the developer for
   future developement.
 * As for the opening the in-app browser – this is one of the reasons that using
   your own theme is not recommended.
 * If you use cross-domains or _blank targets it will open in the in-app browser.
 *  [Bj123](https://wordpress.org/support/users/bj123/)
 * (@bj123)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237522)
 * [@ryanio](https://wordpress.org/support/users/ryanio/), did you find a solution
   for the menu links opening in Safari? How did you solve this? I still can only
   make this work with some custom java script on my theme, which causes other issues
   with lightbox, etc., so that I want to avoid that. This has to work by default
   with Cordova somehow as I just have standard links and no _blank, etc…
 *  Thread Starter [Ryanio](https://wordpress.org/support/users/ryanio/)
 * (@ryanio)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237527)
 * [@bj123](https://wordpress.org/support/users/bj123/) I still do not have a solution.
   May I ask, could you post your javascript snippet? I feel like I’ve tried everything
   and im getting a bit desperate now.
 * Dave, I have tried to use _blank targets but still no dice. It seems like no 
   matter what the links open with safari. Do you have any other potential solution
   I could try?
 *  [Bj123](https://wordpress.org/support/users/bj123/)
 * (@bj123)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237533)
 * Let me first say that I am not a web developer but merely building my own site.
   I searched on google and found someone else’s java script regarding old fashioned
   web apps. Thus it is not really made for a phone gap hybrid app like this one
   here. It seems that this is in Phonegap/Cordova controlled by plugins and by 
   default usually everything stays in the App. Usually people are having a hard
   time getting _blank links out of the App. That’s why it is quite unusual that
   it opens everything in Safari. I just copied this into my custom java field of
   my theme on the dashboard but it has influence on the entire website and photo
   lightbox, some other pop-out, etc doesn’t work anymore. That’s why I can only
   use it for basic testing and it does not resolve the problem of making the app
   work:
    — $(‘a’).live(‘click’, function (event) { var href = $(this).attr(“href”);
 *  // prevent internal links (href.indexOf…) to open in safari if target
    // is
   not explicitly set_blank, doesn’t break href=”#” links if (href.indexOf(location.
   hostname) > -1 && href != “#” && $(this).attr(“target”) != “_blank”) { event.
   preventDefault(); window.location = href; }
 * });
 *  Thread Starter [Ryanio](https://wordpress.org/support/users/ryanio/)
 * (@ryanio)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237534)
 * [@bj123](https://wordpress.org/support/users/bj123/) thank you for that.
 * I also agree it is very strange that it is opening in safari every time.
 * I am also not a developer but I would imagine you could maybe adjust that a little
   to work for only the menu by using the .class selector and giving the menu items
   a class. maybe something similar to below:
 * $(‘a’).live(‘click’, function (event)
    { var href = $(“.menuClass”).attr(“href”);
 * // prevent internal links (href.indexOf…) to open in safari if target
    // is 
   not explicitly set_blank, doesn’t break href=”#” links if (href.indexOf(location.
   hostname) > -1 && href != “#” && $(this).attr(“target”) != “_blank”) { event.
   preventDefault(); window.location = href; }
 * });
 * This does not work for me, but maybe it will help you.
 *  Plugin Author [Dave Anthony](https://wordpress.org/support/users/mobilerockstar/)
 * (@mobilerockstar)
 * [10 years ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237612)
 * Hi guys,
 * I’m currently working on this. I hope to have a fix in tonight’s release.
 *  Plugin Author [Dave Anthony](https://wordpress.org/support/users/mobilerockstar/)
 * (@mobilerockstar)
 * [10 years ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237614)
 * Has the latest update solved your problem?
 *  [Bj123](https://wordpress.org/support/users/bj123/)
 * (@bj123)
 * [10 years ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237615)
 * For my part I don’t know because I used another solution for my app. Someone 
   else maybe can answer this please.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Menu Items Opening Browser Window’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordapp-mobile-app_165676.svg)
 * [WordApp Mobile App Plugin - Convert your WordPress Site to a Mobile App](https://wordpress.org/plugins/wordapp-mobile-app/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordapp-mobile-app/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordapp-mobile-app/)
 * [Active Topics](https://wordpress.org/support/plugin/wordapp-mobile-app/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordapp-mobile-app/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordapp-mobile-app/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [Bj123](https://wordpress.org/support/users/bj123/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/menu-items-opening-browser-window/#post-7237615)
 * Status: not resolved