Phonegap disable x-frame-option in webview - android

i have a problem that is when i open a site like facebook.com in iframe in my phonegap app don't open because x-frame-option.
my question is can i disable checking x-frame-option from java code of cordova webview ?
or use another webview in the same activity one it top and on at down and change the url of webview ?
i'm not good on phonegap and not good in android please help me :D
Thanks all

I found the great solution in this amazing plugin
https://github.com/Wizcorp/phonegap-plugin-wizViewManager
you can add a webview to android and ios and select it position it's really great.

I would assume it isn't possible to allow it on Cordova because it is up to web view of device to handle. What you probably could do is to first download the HTML for some page with AJAX query, strip the
<meta http-equiv="X-Frame-Options" content="DENY" />
of from there and then inject the whole content into iframe. Of course this only works for single page but if that is SPA (single-page application), it might even be enough.

Related

Phonegap hybrid app | Webview

I have downloaded PhoneGap, the problem is:
When I'm trying to load a webview like in java, and it keeps opening a browser.
I want it to open the web on the same browser of the app , How do I make such a thing ?
I have tried editing the config.xml file with the following
<preference name="stay-in-webview" value="true" />
Still, it makes a jump into a web browser. really weird.
Do you want to open a Web URL at the same instance of your App? If thats the case, do not do it. It will just broke your application because a lot of elements from cordova will just have strange behavior, like BackButton or onDeviceReady.
If you want to open content from a website inside your App, use other ways, like iframes/RSS feeds or even HTML analysis (check page HTML content and filter any relevant information).
But, if you want to open it anyways, do the following:
window.location.href = "http://www.google.com";
Hope it helps. Best regards!

How to get the content of website in phonegap?

I have to design a android,ios application for my website.I searched and find out that phonegap can be good one for that.Please provide me info that how to get the content of website in phonegap?On the first page i have buttons like home,contact etc.On click of home button,the home page from website should be shown.
PhoneGap is set of libraries like jQuery.
You normally write html pages and include javascript files from phonegap.
Check out phonegap example project.
Look, what you are talking about is .html,.css,.js files that you can easily get after saving any web page from your web-browser.
Rest you can use in the www folder of your phonegap project. And I
would rather suggest you to go for webview present in the native
android that is nothing but actually would provide you the same
functionality that you have been looking for.
---Edit---
Now as you have said that you want the home page buttons like about us etc. that would be copied via web browser and would be there for you as far as the html code is concerned but if you want it to look well on a small mobile device that you should create a responsive designed html and you should read some good articles about responsive web design. That would actually change your way of thinking about creating applications via html within mobile devices.

Phonegap navigation

I am confused about how to architecture my phonegap application.
Do I use a single-page application wherein I load relevant views using ajax ?
Or should I use many local html files and keep navigating between them using href tags ? Also, window.location seems to load the second page in a browser window, which is undesirable. I want to have whole of my app running in the same webview.
How can I stay on the same webview, while navigating between the pages using javascript ?
Try using a javascript framework like backbone or sencha touch. Jquery-mobile will work but everything will be encapsulated on one page

Android webview to work like native browser

I experimenting with WebView in Android and I can't figure out how to make it work like the native browser.
I have an example for this:
Go to deviantART.com in native browser. Press Menu button. At the bottom of the menu there will be a link to disable mobile view and it works as expected. This exact same thing doesn't work in WebView. It simply turns the menu off and that is all, mobil CSS still stays intact.
I need to make users disable deviantART's mobile CSS, so I need the WebView to work like this.
JavaScript and DOMStorage are enabled.
I need the proper code or an workaround, but after hours of searching I didn't find anything that connected to this problem.
Thank you in advance.
If all you want is to turn off the mobile view you can set the user-agent string on the WebView using setUserAgentString (String ua).

Android Developer:: Opening external link within the app

Happy Friday to all.
I was wondering if there is a way to open an external link within the app itself? I currently can execute a link, but it opens it in a browser. I would like to open a site or two within the app.
Can this be done?
Oh, please tell me it can be, because this is one of the reasons why I am creating my app in Eclipse instead of Dreamweaver...html can only limit so much stuff!
please and thank you help me figure this out.
Cady
Yes, you need to use a WebView and load the html into it yourself.
Note that by default a WebView only displays html content. The plugins and javascript are off, and it does not handle link clicks, or forward / backward navigation
http://developer.android.com/reference/android/webkit/WebView.html
You can use a WebView to open HTML pages inside your app. There's a nice little tutorial in the docs showing the use of its basic features.
You can use WebView, put it in your layout and load URLs to show websites inside your app.
Yes it can be done, you can use a WebView to load the content inside your activity.

Categories

Resources