I am using inappbrowser to open external link in my project for ios. But the external link has horizontal scroll in "inappbrowser" , when i am opening the link in system browser ,it is opening fine. Is there any way so that i can get the external link view without scroll in inappbrowser. I am using cordova 2.8.0.
Thanks in advance .
You have many options that you can customize your view.
https://github.com/apache/cordova-plugin-inappbrowser#cordovainappbrowseropen
I dont understand if the problem is that the webview is not correctly zoomed, or you want do disable the horizontal scroll, but check this two options:
enableViewportScale and disallowoverscroll
The server that you are opening the link to may be looking for specific user agent matches to serve a mobile page template, hard to say without more detail. If that's the case, then you can override the In App Browser's user agent with a string of your choice (e.g. to match whatever the server might be expecting in order to make it render a "mobile" page).
To use this you'll need to get Cordova upgraded to something newer than 2.8 which I would recommend doing in any case, then look at the "OverrideUserAgent" setting, example from the docs:
<preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" />
Related
I've met a very strange bug when tried to open my web site http://akr-congress2016.ru/ in iOS Safari. Please see the screenshot below.
It seems like some elements are loaded from a completely other web site. The new site is a copy of the old one, but layout files (I'm using Phalcon) are changed. There is no link to the old web site at the page.
Also I've noticed doubled logo, it seems like a rendering bug.
When I refresh the page it is loaded normally.
I'm weird what might make Safari to load some fragments of the page from completely another domain.
The screenshot
Try to remove cache from browser. Or maybe it's just an issue of DNS. In that case you just need to wait untill DNS will get updated.
I've built an app using PhoneGap and am using its InAppBrowser plugin. For the iOS platform, the InAppBrowser is implemented using an UIWebView. The "address bar" is a simple UILabel so it is basically read-only from the user's perspective.
I'd like to extend the plugin to have a simple functioning address bar. You know, let the user type in new URLs and show little inline refresh and go buttons. Basically like a regular browser such as Mobile Safari, Chrome, etc.
I know 99 programming languages but Objective-C isn't one. :( Mostly, I don't have experience working with the iOS framework.
These assume too much for me to take action on:
iOS WebView with an Address Bar
Adding a header view to a UIWebView similar to Safari and Articles
I'd like to just modify the PhoneGap plugin iOS source itself so I can keep the plugin hooks it provides to my PhoneGap app's javascript.
Here are the two relevant files:
CDVInAppBrowser.h and CDVInAppBrowser.m on Github
Hopefully this is a welcome challenge to some one already proficient in Objective-C & iOS?
Or maybe you can accelerate me in making the changes myself?
Thanks!!
So you can see what the current UIWebView (with UILabel for Address) looks like:
I am loading the given URL in web browser using the following code;
BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage(url);
Problem is, whenever I run this code, web browser opens the URL in a new tab (even if the URL is same). I want to reuse the existing tab or at least close the previously opened tab. In short I don't want to end up having a pile of tabs after firing several URLs.
Please guide me if there is any way to achieve this. I don't want to use BrowserField.
I am using;
BlackBerry Eclipse JDE 1.5
Target BlackBerry OS 4.5
Tested on BlackBerry Bold 9900 on Wifi network
I think the only one possible solution display pages inside your application by using BrowserField or RenderingApplication. There are samples available included to JDE or eclipse plugin.
After loading up a Webclip with some links in it, clicking a link launches Mobile Safari instead of loading the link in the same window. Is there a way to prevent the link loading in Safari instead of the Webclip instance? I'm trying to mock up a mobile app just using PHP on my local Apache installation.
According to the Apple docs it looks like external page links will always open in Mobile Safari:
In this mode any external links will be opened in Safari on
iPhone, meaning that you will have to keep your web application to a
single page and use Ajax to update parts of that page.
In addition to the option of using a single page loading new content with AJAX, you can use the JavaScript self.location=URL; return false on hyperlinks that must stay within the application. This can be added to the HTML code directly, or with another script upon loading the page.
If you are using jQuery, I would recommend something like this:
$('a:not([target])').click(function(){
self.location = $(this).attr('href');
return false;
});
Obviously this script should be ran after the HTML has loaded, to ensure that it actually attaches to the A elements onClick event.
Using the JQTouch library, usely links like the following ... should open the new page in the SAME window. That works fine when I go to the site using Safari BUT when I launch the site from the home saved icon, it opens a fullscreen site and on the first link it opens a NEW Safari window. How can I make it stay in the same original fullscreen window?
You have to set the target to _webapp. E.g:
<li class="arrow">Some Page</li>
and then it will load on the same page.
You need to look into manifest files.
The manifest file declares what files (html, javascript, css, jpgs etc.) that the iPhone should cache in order to make a webapp work offline. A part of the manifest file is used to declare which URLs are OK to use when in full screen (webapp) mode.
Specifically look at NETWORK in manifest files.
Example:
NETWORK:
*
This should allow access to any URL you like, and stay in webapp mode.
Alternatively use target="_self" - I haven't seen target="_webapp" anywhere.
/Mogens
One solution I found here is to change the way you write your links for a mobile app. Rather than a href='link.url' you'd write a href="javascript.window.location.href='link.url'"
Dislaimer: I haven't personally tried this yet, so I can't guarantee it will work. But logically, it does make sense.
Using target="_webapp" works only if you remove the rel="external", you cannot have both.